I'm trying to build this Horizontal dropdown menu in CSS and make it get the menu-options from MySQL database.
The problem i'm having is excluding 2 of the layoutrows from beeing looped.
It's rows number: 23 & 25.
I want row number 24 to be able to repeat between the 23th and 25th line.
If i put number 23 and 25 outside second "While" loop, my menu gets all fu**ed-up :/
<ul id="dropdown"> <? include 'connect.php'; mysql_select_db("nysa_me", $con); $result = mysql_query(" SELECT * FROM menu_sub WHERE parent=0 ORDER BY id ASC ") or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo '<li><a href="'.$row['link'].'">'.$row['name'].'</a>'; mysql_select_db("nysa_me", $con); $result2 = mysql_query(" SELECT * FROM menu_sub WHERE parent=$row[id] ORDER BY id ASC ") or die(mysql_error()); while($row2 = mysql_fetch_array($result2)) { echo '<ul id="sub">'; echo '<li><a href="'.$row2['link'].'">'.$row2['name'].'</a></li>'; echo '</ul>'; } } ?> </ul>
Edited by nygorn, 21 August 2012 - 04:10 PM.