Let's say we have a query that gives a result from database's records. I want to put those records on a table, but not like row after row. I would like to make a table that will change row on every fifth cell. How can I do this using while
or for
?
Here is just an example of what I have made for now, but I can't make it change row on every fifth cell...
<table>
<tr>
<?php $count = 0; while ($count <= 5){ ?>
<td><?php echo $id[$count]->id; $usrname[$count]->usrname;</td>
<?php $count++;}?>
</tr>
</table>
Any idea???