Let's say I have a user that entered 12 links into the database but when they are displayed I want to break up the links into groups of 3 and repeat the groups of three until all 12 kinks are displayed for example.
<div>
<p><a href="">Link 1</a></p>
<p><a href="">Link 2</a></p>
<p><a href="">Link 3</a></p>
</div>
Here is part of the code I'm working with. How should my code look like?
while ($row = mysqli_fetch_assoc($dbc)) {
if (!empty($row['category']) && !empty($row['url'])) {
echo '<div>';
echo '<p><a href="' . $row['url'] . '" title="' . $row['category'] . ' Category Link">' . $row['category'] . '</a></p>';
echo '</div>';
}
}