This is my code:
$query = mysql_query("SELECT * FROM books ORDER BY id") or die(mysql_error());
while($row = mysql_fetch_assoc($query)) {
echo $row["bookname"]." - ";
}
How to make only 5 books displayed in each line, by inserting a
at the start if the row is 5 or 10 or 15 etc…
Thanks
You could keep count of the times you’ve looped (increment a variable each time).
Compare the value modulus 5. If the result is 0 output the