in reply to Perl and a little style.

I'm a recent convert to HTML::Template and I think it may be of use here.

For a loop it needs an array of hash refs.

$sth = $dbh->prepare( 'SELECT * FROM guestbook' ); $sth->execute; my @ht_data; while( $row = $sth->fetchrow_hashref ){ push @ht_data, $row; } my $template = HTML::Template->new(filename => 'table.tmpl'); $template->param(TABLE_LOOP => \@ht_data); print $template->output();

In your template the loop would look something like this

<table class="user_form"> <TMPL_LOOP NAME=TABLE_LOOP> <tr> <td width="25%" class="name" > <TMPL_VAR NAME=NAME > </td> <td width="50%" class="email"> <TMPL_VAR NAME=EMAIL> </td> <td width="25%" class="date" > <TMPL_VAR NAME=DATE > </td> </tr> <tr> <td class="host"> Ευχή του Ιησού </td> <td class="tip" colspan="2"> <TMPL_VAR NAME=PRAY> </td> </tr> <tr> <td class="tip"> <TMPL_VAR NAME=NAME> </td> <td class="remark" colspan="2"> Προσωπική Ορθοδοξοπνευματική Εμπειρία </td> <td width="25%" class="date"> <TMPL_VAR NAME=DATE> </td> </tr> </TMPL_LOOP> </table>

Untested. I don't have access to SQL. Hope this helps.

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.