<?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');
?>