in reply to Re: Re: multiple perl-mysql queries...
in thread multiple perl-mysql queries...

Using your original code, it would look something like this:
my $sth = $dbh->prepare("select * from foo"); $sth->execute; print qq~<table>\n~; print qq~<tr>\n~; foreach (@{$sth->{NAME}}) { print qq~<th>$_</th>\n~; } print qq~</tr>\n~; while (my @ary = $sth->fetchrow_array) { print qq~<tr valign="top">\n~; foreach (@ary) { $_ = defined($_) ? $_ : '&nbsp;'; print qq~<td>$_</td>\n~; } print qq~</tr>\n~; } print qq~</table>\n~;
But if you haven't tried DBIx::XHTML_Table yet, please do.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)