in reply to Database Layout

to display the fields horizontally (4 per row , in this case) instead of vertically, try something like this :
$cnt=1; print "<tr>\n"; while (($cnt++ % 5) != 0) { print " <td>test</td>\n"; } print "</tr>";