I have a query, $query, and I display the data using a simple
while($row = mysql_fetch_array($query))
{
// display data
}
However, I want the data to be displayed with 3 columns and with as many rows as necessary.
Eg: If there are 3 rows in the query, the results will be displayed in an html table (1x3)
If there are 6 rows in the query, the results will be displayed in an html table (2x3)
If there are 8 rows in the query, the results will be displayed in an html table (3x3) with the last row and last column being empty.
How do I do this? Thanks in advance for your help.