all i want to do is end the current, and begin a new UL every 10 results
heres my code which isn’t working 100%:
$sql1 = mysql_query("select * from `provinces` order by `name` asc");
while ($row1 = mysql_fetch_assoc($sql1))
{
echo '<li id="popup_'.strtolower(str_replace(' ', '_', $row1['name'])).'">';
echo '<ul>';
$sql2 = mysql_query("select * from `cities` where `id_province`='".$row1['id']."' order by `name` asc");
$count = 1;
while ($row2 = mysql_fetch_assoc($sql2))
{
if ($count % 10 == 0)
echo '</ul>';
echo '<li>'.$row2['name'].'</li>';
if ($count % 10 == 0)
echo '<ul>';
$count++;
}
echo '</ul>';
echo '</li>';
}
replace this
with
And completly remove the second check
Otherwise your html screws up
// took me some time to get this answered because the problem was not easy to indentify 🙂