<?php
// show data from a mysql query in columns
// change the query below as needed, and the
// "$cols" variable to set the number of columns
$the_query = "SELECT * FROM mytable";
$result = mysql_query($the_query);
$rows = mysql_num_rows($result);
$rcounter = 1;
$cols = 2;
print ('<table>\n');
for($i = 0; $i < $rows / $cols; $i++) {
print ('<tr>');
for($j=0; $j < $cols && $rcounter <= $rows ;$j++, $rcounter++) {
print ("<td>(data to be displayed goes here)</td>\n");
}
print ('</tr>\n');
}
print ('</table>\n');
?>