Hello everyone!
I was looking for some help with php and mysql and found this forum.
I am managing a shop website which is using php and mysql for data.
The website has a section that will display the related products with the one that you are watching. Now my problem is that if there are more than 5 items it will continue to display all the items in one row with the consequent that the page will not display well.
I need to find a way to begin a new row after the 5th item so it will display 5 items in each row.
this is my current code that is responsible for showing the related items. There is also a picture attached with the problem.
while ($row = mysql_fetch_array($retd))
{
$code = $row["code"];
$name = $row["name"];
echo("<td width=150 align=center>");
echo ("<a href=../products/info.php?scode=$code><img src=pictures/$code.gif border=0 alt=Item $name</a>");
echo ("<br><a href=../products/info.php?scode=$code><span class=fs13>$name</span></a>");
echo("</td>");
}
Does anyone know how can I do this?