Jump to content

Nested While loop not works


vinoindiamca

Recommended Posts

Nested While loop not working in IE but works perfect in Firefox

 

i used tree view to list out my main category ,sub category and sub-sub category

like

Art (Main Category)

  |-Drawing(Sub Category)

  |-Painting

            |-Brush(Sub-Sub Category)

            |-Colors

 

<?php

include_once("../includes/connect.php");

$select = "select * from maincat ";

$res = mysql_query($select);

$rec_count = mysql_num_rows($res);

 

 

 

?>

 

 

 

<div id="sidetree">

<div class="treeheader"> </div>

<div id="sidetreecontrol"><a href="?#">Collapse All</a> | <a href="?#">Expand All</a></div>

<?php

while($row=mysql_fetch_assoc($res))

  {

$mid=$row["mainid"];   

$mname=$row['catname'];

?>

<ul id="tree"><li>

<strong>

<a href="admin_mcatedit.php?cid=<?php echo $mid;?>"><?php echo $mname;  ?></a>

</strong>

 

<ul>

<?php

$select1 = "select * from subcat where mainid='$mid' ";

$res1 = mysql_query($select1);

 

while($row1=mysql_fetch_assoc($res1))

{

$sid=$row1["subid"];

$subname=$row1['subcatname'];

?>

<li><a href="admin_mcatedit.php?cid=<?php echo $sid;?>"><?php echo $subname;  ?></a>

<ul>

<?php

$select2 = "select * from subsubcat where mainid='$mid' and subid='$sid' ";

$res2 = mysql_query($select2);

 

while($row2=mysql_fetch_assoc($res2))

{

$ssid=$row12["subsubid"];

$ssubname=$row2['subsubcatname'];

?>

<li><a href="admin_mcatedit.php?cid=<?php echo $ssid;?>"><?php echo $ssubname;  ?></a></li>

<?php

}

?>

</ul>

</li>

<?php

}

?>

 

 

</ul>

</li> <?php

}

?>

</ul>

 

</div>

 

Please help me

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.