Right now, I am attempting to have a For
loop create a table displaying the different Herds (Groups) in the Database.
As of now, my code looks like this:
echo '<table>';
for($i = 0; $i < $numrows; $i++) {
$row = mysql_fetch_array($result)
$name = $row['name'];
$avatar = $row['avatar'];
$link = $row['link'];
echo '<tr>';
echo '<td>'.$avatar.'</td>';
echo '<td><a href="'.$link.'">'.$name.'</a></td>';
echo '</tr>';
}
echo '</table>';
Which, displays this:
[Avatar] [Name]
[Avatar] [Name]
[Avatar] [Name]
How would I be able to produce this (all being separate records):
[Avatar] [Name] [Avatar] [Name]
[Avatar] [Name] [Avatar] [Name]
[Avatar] [Name] [Avatar] [Name]
Any help would be much appreciated. Also, If I am missing something, please let me know.