Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi, hope someone can help out here with my 1st question to the monks.
I'm just starting to venture into the world of CGI.pm and trying to use the module instead of hand coding HTML.
My main problem is something which I suspect is simple, and just down to my inexperience - I'm reading some data from mysql and generating a table to display the output. I've no problem getting the data from mysql, but what I'm having problems with is displaying it using pure CGI inside a loop.
At the minute, I'm mixing hand coded HTML & CGI object's as shown below:
...my $html_page = new CGI;
I suspect there must be a way of integrating the loop into the print, something likeprint "<TABLE>\n"; while (my $db_data = $sth->fetchrow_arrayref()) { print $html_page->Tr( $html_page->td($db_data) ); } print "</TABLE>\n";
but at the minute I'm lostprint $html_page->table( while ...... { $html_page->Tr( $html_page->td($db_data) ) } );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: CGI Tables
by Zaxo (Archbishop) on Sep 01, 2002 at 03:18 UTC | |
by sch (Pilgrim) on Sep 01, 2002 at 03:42 UTC | |
by sch (Pilgrim) on Sep 08, 2002 at 22:56 UTC | |
by Zaxo (Archbishop) on Sep 09, 2002 at 00:41 UTC | |
by sch (Pilgrim) on Sep 09, 2002 at 02:25 UTC | |
|
Re: CGI Tables
by tadman (Prior) on Sep 01, 2002 at 03:11 UTC | |
by Flexx (Pilgrim) on Sep 02, 2002 at 10:20 UTC | |
by tadman (Prior) on Sep 02, 2002 at 13:42 UTC | |
by Flexx (Pilgrim) on Sep 02, 2002 at 15:18 UTC | |
|
Re: CGI Tables
by rinceWind (Monsignor) on Sep 01, 2002 at 09:50 UTC |