PHP random repeat rows?

Kelly H

New member
Hey everyone i need some help,

I want to make this code for mat with 4 products on first row and 4 products on the second and 4 on the third and so on.
as of right now using the code below it shows one on each row i want it to show 4 on row 1 and 4 on row two so on and so on.

How do i do this?


mysql_selectdb("*********",$link);
// Select records from the DB
$query = "SELECT * FROM Products WHERE home='1' ORDER BY Rand() ";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo"<tr>";
echo "<td><a href=\"update.php?id=$row[8]\"><img src=\"$row[7]\" width=\"125\" border=\"0\"><BR><img src=\"http://www.wholesaleinflatable.com/small_more_info.png\" width=130 height=33 border=0 /></a></td>";
echo"</tr>";
}
 
Back
Top