in reply to foreach loop

You need to repeat the ->fetchrow_array for each row until you get an empty list. Something like this (untested)
.. my $i; foreach $i (@field_desc) { print "<TH>$i</TH>\n"; } print qq "</TR>"; my $SQL = "SELECT $field_list FROM property"; my $sth = $dbh->prepare($SQL); $sth->execute() or die $dbh->errstr; my @row; while ( @row = $sth->fetchrow_array() ) { print qq(<tr>); for (@row){ print qq(<td>$_</td>); } print qq(</tr>); } print "</TABLE>"; print $q->end_html; $dbh->disconnect() or die $dbh->errstr;
poj