Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
$dbh = DBI->connect("DBI:mysql:$database:$db_server", $user, $password);
$statement = "SELECT city FROM speedtrap WHERE $FORM{state}";
$sth = $dbh->prepare($statement) or die "Couldn't prepare the query: $sth->errstr";
$rv = $sth->execute or die "Couldn't execute query: $dbh->errstr";
$rc = $sth->finish;
$rc = $dbh->disconnect;
So my @row array should have a list of cities that exist for a specific state that can be unlimited in length. I want to print these cities in a HTML table that has four columns:
Obviously the city names in the HTML above should be automatically generated from the array and not statically printed.<TR> <TD width="25%"> <DIV align=center><FONT color=#2f2cff>Wheaton</FONT><BR></DIV></TD> <TD width="25%"> <DIV align=center><FONT color=#2f2cff>Chicago</FONT><BR></DIV></TD> <TD width="25%"> <DIV align=center><FONT color=#2f2cff>Gurnee</FONT><BR></DIV></TD> <TD width="25%"> <DIV align=center><FONT color=#2f2cff>Lisle</FONT><BR></FONT></DIV></TD> </TR>
How can I make a PERL loop that prints my table automatically?
Thanks,
Adam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Print Array into 4 Column Table
by diotalevi (Canon) on Jun 25, 2004 at 18:06 UTC | |
|
Re: Print Array into 4 Column Table
by jeffa (Bishop) on Jun 25, 2004 at 18:12 UTC | |
|
Re: Print Array into 4 Column Table
by idsfa (Vicar) on Jun 25, 2004 at 18:27 UTC | |
|
Trying to print HTML table, erroring out.
by Anonymous Monk on Jun 26, 2004 at 04:33 UTC | |
by dws (Chancellor) on Jun 26, 2004 at 05:49 UTC | |
by etcshadow (Priest) on Jun 26, 2004 at 04:54 UTC | |
by neniro (Priest) on Jun 26, 2004 at 09:15 UTC |