Welcome to the new platform of Programmers Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use it's exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Display records 3 items in a row and move to next row.
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.