Ok, right now I trying to get a list to echo out from mysql using a while loop, but as you can see here http://institute4se.com/plan/ it's echoing in the wrong order. Why?
The reason for the if statements is to make the top and bottom pieces of the div echo only when the loop reaches the beginning of a new subsection.
If I remove the if statement the list echos out in order but then the beginning and end of the div echo every loop.
You can see my database aka $info here: http://i.stack.imgur.com/QMO2X.png http://i.stack.imgur.com/RsHdb.png
Any thoughts on how to fix it?
while($info = mysql_fetch_array( $data ))
{
if($info['subsection']=='0'){
echo "
<div class='menuSection'>
<div class='sectionHeader' id='header".$info['section']."'><img src='images/status_circ_empty.gif' alt='Section Empty' /><a href='index.php?s=".$info['section']."&ss=".$info['subsection']."'>".$titleArr[$info['section']]."</a><img src='images/arrow_".$currentArrow.".gif' alt='Arrow' class='arrow' /></div>
<ul class='sectionSubmenu' id='section".$info['section']."' style='display:".$currentSection."'>
";
}
else{
echo "<li><img src='images/status_circ_empty.gif' alt='Section Empty' /><a href='index.php?s=".$info['section']."&ss=".$info['subsection']."'>".$info['title']."</a></li>";
}
if($info['subsection']=='0'){
echo"
</ul>
</div>
";
}
}