Hey guys,
I'm a designer turned coder and it would seem PHP has finally warmed up to me. One thing I can't figure out is how to display a catalog with multiple columns. Obviously I would need a <tr></tr> every four <td>'s and I can't quite get it working. This is the basic method I've been using thus far.
My initial thoughts were that I would need to add something like:
$var = 0 before the while() portion and then $var = $var + 1 at the end, and then throw in the <tr></tr> when $var = multiple of 4 or something to that effect, but again I can't get it to work properly.
Thanks for your time.
I'm a designer turned coder and it would seem PHP has finally warmed up to me. One thing I can't figure out is how to display a catalog with multiple columns. Obviously I would need a <tr></tr> every four <td>'s and I can't quite get it working. This is the basic method I've been using thus far.
Code:
<?
$db = mysql_connect("localhost", "un", "pw");
mysql_select_db("db",$db);
$result = mysql_query("SELECT * FROM catagories ORDER BY od asc",$db);
while($myrow = mysql_fetch_array($result))
{
echo "CODE";
}
?>
My initial thoughts were that I would need to add something like:
$var = 0 before the while() portion and then $var = $var + 1 at the end, and then throw in the <tr></tr> when $var = multiple of 4 or something to that effect, but again I can't get it to work properly.
Thanks for your time.









