i have one class in php returning number of records.
i use table to display name like that
foreach($getArtist as $getArtist)
{
echo "<tr><td>".$getArtist['name']."</td></tr>";
}
this works fine and display each name in one row
now i want to display 3 names in one row
foreach($getArtist as $getArtist)
{
echo "<tr>";
echo "<td>".$getArtist['name']."</td>";
echo "<td>".$getArtist['name']."</td>";
echo "<td>".$getArtist['name']."</td>";
echo "</tr>";
}
but this is displaying each name 3 times, but i need to display 3 names in one row then other 3 names in other row and when record finish loop finish
Try:
Edit: quickly inserting DaveRandoms fix to Phils comment 😉