I cannot figure out how to get my code to create a new HTML column for results, in my table, in a while ($row = mysql_fetch_array($result)) { – when the results returned reach 10, I want a new table column to be created in the same HTML table.
How can I do this? The code I’m using is:
while ($row = mysql_fetch_array
($result, MYSQL_ASSOC)) {
$row_color = ($row_count % 2) ? $color1 : $color2;
echo '<tr><td align="left" bgcolor=' . $row_color . '> <b>' . $row['manufacturer'] . '</b>: <a href=view_inventory.php?mdl_key=' . $row['mdl_key'] . '&man_key=' . $row['man_key'] . '&cls_key=' . $row['cls_key'] . '&sub_cls_key=' . $row['sub_cls_key'] . '> ' . $row['model'] . '</a></b></td></tr>';
$row_count++;
}
You should really use the new PDO interface as the mysql extension is deprecated long ago, read this documentation if you have a choice.
Still, with the old extension, simply do this: