PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Right, loops are starting to tick me off ... probably because it's like only 8am. But how do I get it to show 5 results then show another 5 below and so on?
$i = 1;
while ($row = mysql_fetch_assoc($result)) {
// you can determine whether this is a fifth row using the modulus operator
$new_row = ($i % 5 == 0) ? true : false;
// code to create your table cell - if $new_row == true then you
// can end the previous row and start a new one here
$i++;
}
You'll have to do a bit of work with the code but hopefully this will give you a starting point.