develooper Front page | perl.beginners | Postings from April 2002

Re: perl / database question

Thread Previous | Thread Next
From:
Brent Michalski
Date:
April 2, 2002 11:57
Subject:
Re: perl / database question
Message ID:
OF4E60A154.47B328CD-ON86256B8F.006C3A76@com

Just quicky, this is what I see.

1) Use the DBI module and the DBD::Pg driver.  DBI is very well documented.
I've written several articles that use it, it is covered in my book Writing
CGI Applications with Perl (Kevin Meltzer wrote this with me also).

2)   Biggest problem:
while ( my($first, @full_list)=$list_tbl->fetchrow){
    print h1($TITLE), hr;
    print start_form,
    print "<select name="tables" multiple size=3>";
    print "<option>"$first;
    print "</select>";

    print submit, reset;
}



Each time you fetch a new row, you add a <hr> element!  Wouldn't this make
more sense?
print h1($TITLE), hr;
print start_form,
print "<select name="tables" multiple size=3>";

while ( my($first, @full_list)=$list_tbl->fetchrow){
    print "<option>"$first;
}

print "</select>";
print submit, reset;


I am not sure exactly what you are looking for, but I hope this helps out!.

P.S.  The DBI module is available at: http://dbi.perl.org

Brent







Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About