Expand and collapsing
Posted: Thu Nov 10, 2011 10:32 am
why does my javascript code expanding and collapsing not working inside of loop
<div id="categories"> <?php $sel = "select * from `blog_cat`"; $cat = mysql_query($sel); while($data = mysql_fetch_assoc($cat)){ echo "<a href='JavaScript:doMenu('main');' id=xmain>[+]</a>$data[name]"; $sel2 = mysql_query("SELECT * FROM `posts` WHERE `post_cid`='".$data['id']."'"); while($data2 = mysql_fetch_assoc($sel2)){ echo " <div id=main style='margin-left:1em'> <a href=#>$data2[post_title]</a><br> </div> <br> "; } } ?> </div>