- Kevin Diffily <[EMAIL PROTECTED]> on 07/15/01 19:52:15 -0400:
> Can anyone offer a simple example of retrieving information with DBI and
> displaying it in HTML? I am simply looking for the basic syntax.
>
> I am new to DBI but have pretty extensive Perl and Website experience.
HTML::Table
At its most basic:
my @html = ( '<table>' );
push @html, join "<th>', '<tr>', qw( table header strings );
push @html, map { join '<td>', '<tr>', @$_ } $sth->selectall_arrayref ;
push @html, '</table>';
my $result = join "\n", @html;
The array makes it a bit simpler to isolate changes between the
sections. Joining the result on newlines won't effect the final
display but makes reading / debugging things simpler.
sl