split a result list from mysql into separate lists based on list length
- by liz
i have a list of returned rows from mysql that i am outputting using php:
echo '<ul class="mylist">';
foreach ($rows as $row)
{
echo '<li><a href="'.$row->url.'" target="_blank">' . $row->title . '</a></li>';
}
echo "</ul>";
works fine, but its a long list and i would like to split it into ul chunks so that i can make columns.
maybe like 5 results per ul. instead of one ul...
i tried wrapping in a for statement but then just wound up outputting the results 5 times...oops...