Jump to content

Display MySQL Information over Multiple Columns in a Table


adammcmillan

Recommended Posts

try

<?php
$result = mysql_query($sql) or die(mysql_error());
$ceil_in_row = 3;
echo "<table>\n";
while ($row = mysql_fetch_array($result)){
echo "<tr>\n";
echo "\t<td>",$row['name'],"</td>\n";
for ($i = 1; $i < $ceil_in_row; $i++){
	if ($row = mysql_fetch_array($result)) echo "\t<td>",$row['name'],"</td>\n"; else echo "\t<td> </td>\n";
}
echo "</tr>\n";
}
echo "</table>";
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.