I have a simple code that grabs the ID and Name of about 400 games listed in the database. Below is the code. As you can imagine, the list is very long. To make it easier, I have made it so every other record is bold. However, instead of the page being 400 lines long, I want it to have 4 games per row and 100 rows in a table to shorten the length of the page. I have tried many things, and am not sure if I should do it like I did with the bold font. Any help would be appreciated.
<?php
include("common.php");
mysql_connect($Host, $User, $Pass)
or
die("could not connect");
mysql_select_db($DB);
$result = mysql_query("SELECT id, name FROM Games");
while ($row = mysql_fetch_array($result))
{
$bold=$bold+1;
if ($bold==1)
{
printf ("<b>ID: %s Name: %s </b><br>", $row[0], $row["name"]);
}
else
{
printf ("ID: %s Name: %s <br>", $row[0], $row["name"]);
$bold=0;
}
}
mysql_free_result($result);
?>