Hi all,
I want to display a cretain number of results per row in a table.
e.g. I want to display 5 results per row - id 1-5 will be in row1; id 6-10 row2, etc..
How do I fix my code below to do this? Thanks.
if($num_results > 0)
{
echo '<table><tr>';
while($row = mssql_fetch_array($result))
{
for($i=0; $i<5; $i++)
{
echo '<td>';
echo '<a href="index.php?id='.$row['id'].'">'.$row['name'].'</a>';
echo '</td>';
} // end for
} // end while
echo '</tr></table>';
} // end if