How to insert <br/> after each 5 results?

Posted by Axel on Stack Overflow See other posts from Stack Overflow or by Axel
Published on 2010-04-19T03:52:46Z Indexed on 2010/04/19 3:53 UTC
Read the original article Hit count: 261

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql