I would like to seek help on how to display 3 items in a row and move to next row. I have a short piece of code here and hope someone out there could help me on this.
Let say I have 4 records in database :
$query = "Select * from products";
$result = $db_mysql->query($sql);
while ($row = mysql_fetch_row($result))
for($i=0; i<2; $i++)
[b][color=Red]<? echo $row[id] ?>[/color][/b]
The output display is 1 2 3 4 but I want it to be displayed like this
1 2 3
4 5 6
7 8 9
10 11 12
I would greatly appreciate if someone could help me on this.
Thank you buddies.
0 · ·