<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated on Sat, 04 Feb 2012 06:50:38 -0600 -->
<rss version="2.0">
  <channel>    <title>Codeassembly - How to display inifinit depth expandable categories using php and javascript</title>
    <link>http://www.codeassembly.com/feed/comments/21</link>
    <description>CodeAssembly - Simplicity is prerequisite for reliability - Comments</description>
    <language>en-us</language>
    <managingEditor>contact@codeassembly.com</managingEditor>
    <webMaster>contact@codeassembly.com</webMaster>
    <generator>RSS Feed Generator</generator>
    <item>
      <title>Anuj </title>
      <description>Hi
   Need your some more help. This code works fine if one category is inserted only once. But how do we achieve if we insert category more than once. 

Like

WebDevelopment
          HTML

MISC
          HTML
                 HTML1
                 HTML2
                 HTML3


Other 
          HTML

here HTML lies three times. 

If you have some time please help.

</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#399</link>
      <pubDate>2011-12-26 05:53:58</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#399</guid>
    </item>
    <item>
      <title>Anuj Koundal</title>
      <description>Hi 
   Thanks Codeassembly for such an easy code It works for Asp .net C# Tooo

Thanks 

For ASP .net guys here is my code:

Bind dataset or genric list with data and follow the code.

  string treeList = string.Empty;
        public string BindEmp(int ParentId)
        {
            Boolean hasChild = false;
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                if (ParentId == Convert.ToInt32(dr["projEmp_ParentEmpId"]))
                {

                    if (hasChild == false)
                    {
                        hasChild = true;
                                                   treeList += "<ul>";
                       
                    }
                    treeList += "<li>" + dr["empname"].ToString();

                    BindEmp(Convert.ToInt32(dr["projEmp_EmpId"]));

                    treeList += "</li>";

                }

            }

            if (hasChild == true)
            {
                treeList += "</ul>";
            }

            return treeList;
        }

Hope this help someone.


Thanks 
Anuj Koundal</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#398</link>
      <pubDate>2011-12-23 03:19:04</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#398</guid>
    </item>
    <item>
      <title>Arif Majid</title>
      <description>Works perfectly...
one single query ... print all the categories and its subcategories(multiple level)..

But if its a huge category list i wud rather cache the output in a file and fetch it from there, 
so that i dont have to use this function 
unless there was a change in the (CRUD operation done on the category table) categories list.

thanks 
Arif</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#386</link>
      <pubDate>2011-09-14 06:22:32</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#386</guid>
    </item>
    <item>
      <title>babar</title>
      <description> very good example.i just want to add just two lines.

1. add id field also

$menu_array[$row['id']] = array('name' => $row['name'],'parent' => $row['parent'],'link' => $row['link'],'id'=>$row['id']);

2. make it dynamic

echo '<li><a href="products.php?cid='. $value['id'] . '">' . $value['name'] . '</a>';

thanks</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#374</link>
      <pubDate>2011-06-30 19:53:46</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#374</guid>
    </item>
    <item>
      <title>Balone</title>
      <description>Hi,
this worked perfectly. can you tell me how to worked this with combobox?(dropdown)

Thanks for any reply.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#361</link>
      <pubDate>2011-01-10 06:15:34</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#361</guid>
    </item>
    <item>
      <title>Mahi</title>
      <description>Hi,
really nice code but I want a multi dimension array one row for one record. but I can't able to do this I am new in php can you help me. actually I want to show this data in a list format. 
regards,
Mahi,</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#357</link>
      <pubDate>2010-12-18 02:45:46</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#357</guid>
    </item>
    <item>
      <title>Chintan</title>
      <description>Hi Thanks for sharing program.but how can i display all parent & child categories in dropdown with differentiation..
like 
Parent1<br>
---Childparent1<br>
Parent2<br>
---Child1parent2<br>
------childchild1parent2</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#342</link>
      <pubDate>2010-09-03 05:51:01</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#342</guid>
    </item>
    <item>
      <title>kevs</title>
      <description>Is it possible, using this code, to output a categories and it's subCat based on a specific ID?

Web Developement ID is 1. I want to fetch only Web Developement and it's child. 

How do I do that?

Please help </description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#309</link>
      <pubDate>2010-03-25 11:11:28</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#309</guid>
    </item>
    <item>
      <title>Rob @ Web Design Talk</title>
      <description>GReat piece of code. Tested with a very very large category table and things are little slow. However for my shop that has 4 levels of categories this is absolutely perfect. 

Thanks</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#294</link>
      <pubDate>2010-03-08 13:13:08</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#294</guid>
    </item>
    <item>
      <title>Someone Nordic</title>
      <description>You have just solved my 2 day-old vb headache with that recursive function. Awesome job</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#293</link>
      <pubDate>2010-03-03 06:46:23</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#293</guid>
    </item>
    <item>
      <title>Techie Talks</title>
      <description>Great codes, I  am really having a hard time displaying the cat subcat that I have in a way it will show up like a combo box.  Thank you!</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#273</link>
      <pubDate>2009-11-20 23:58:48</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#273</guid>
    </item>
    <item>
      <title>Jason</title>
      <description>Hi, thanks so much for this code; I am writing a file manager component for Joomla and I couldn't figure out how to manage unlimited sub-categories cleanly, and with only using one database query.
 </description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#249</link>
      <pubDate>2009-07-13 01:59:25</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#249</guid>
    </item>
    <item>
      <title>Zaheer</title>
      <description>Hy Barry, By "you need to select the rows inside the function instead of declaring the menu_array as a global" he means to remove global declaration of array from the function definition and pass it to the function as a argument.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#247</link>
      <pubDate>2009-07-01 05:58:12</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#247</guid>
    </item>
    <item>
      <title>Thomas</title>
      <description>Hi, I enjoyed your tutorial. However with a category structure of up to 3000 different rows. The code does run slow.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#201</link>
      <pubDate>2009-02-12 04:30:44</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#201</guid>
    </item>
    <item>
      <title>Paresh</title>
      <description>Hi, Good Worked. I can\'t able to list the display in ul li order. with the help of your code, i can. 


Thanks</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#138</link>
      <pubDate>2008-07-06 03:46:39</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#138</guid>
    </item>
    <item>
      <title>Nguyen Duc</title>
      <description>Hi, I tried using a $var just replace "echo" in this function but can't. Help me because I am using Xtemplate for my project.
Thanks </description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#105</link>
      <pubDate>2008-05-01 14:22:23</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#105</guid>
    </item>
    <item>
      <title>Barry</title>
      <description>Please provide an example of what you mean by "you need to select the rows inside the function instead of declaring the menu_array as a global." I have had the same issue with only one set of results being displayed.

Thank you.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#104</link>
      <pubDate>2008-05-01 14:22:23</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#104</guid>
    </item>
    <item>
      <title>Nguyen Duc</title>
      <description>Hi, I tried using a $var just replace "echo" in this function but can't. Help me because I am using Xtemplate for my project.
Thanks </description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#101</link>
      <pubDate>2008-05-01 14:22:23</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#101</guid>
    </item>
    <item>
      <title>Jeremy</title>
      <description>First - thanks for the tutorial. Mauro, I had the same problem (worked on one server but only first row shows on a different server). Can you explain what you mean by selecting the rows inside the function instead of declaring the menu_array as global? Thanks.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#100</link>
      <pubDate>2008-04-18 00:57:45</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#100</guid>
    </item>
    <item>
      <title>Tim</title>
      <description>What about deleting? No one ever shows about deleting. I'm not talking DELETE WHERE id = $id AND parent = $id I'm talking if theres a Parent with a Child(1) that has a child(2) that has a child(3). If you delete the main parent how would it go about deleting all the way up to child 3 as child 2 is it's parent and child 1 is child 2's parent and parent is the parent of child 1. Hope I didn't confuse anyone.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#95</link>
      <pubDate>2008-05-01 14:21:24</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#95</guid>
    </item>
    <item>
      <title>Mk</title>
      <description>This code is great.  I'm using the one with CSS formatting, not the javascript expandable one.  My problem is the category names are linked and I don't want them to be.  I only want the subcategories to be linked.  On this page, the example shows the categories as unlinked, but when I use the code, it makes my category names linked.  Any ideas?</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#76</link>
      <pubDate>2008-03-21 14:02:43</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#76</guid>
    </item>
    <item>
      <title>Mel</title>
      <description>Hi Mauro, I have the same problem as Jason but I dont understand you explination. What does this mean "you need to select the rows inside the function instead of declaring the menu_array as a global."? What does that mean? Which part of the script must I edit? Can you please give us an example.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#67</link>
      <pubDate>2008-03-21 14:02:43</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#67</guid>
    </item>
    <item>
      <title>Jason</title>
      <description>Cheers Mauro - you are a star. It now works a treat :-))</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#48</link>
      <pubDate>2007-11-26 07:50:36</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#48</guid>
    </item>
    <item>
      <title>Mauro</title>
      <description>Hi, the problem is that you need to select the rows inside the function instead of declaring the menu_array as a global. It should work after that.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#43</link>
      <pubDate>2007-11-26 07:31:52</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#43</guid>
    </item>
    <item>
      <title>Jason</title>
      <description>Hi,

Strange - I've also tried example above from Rik Moncur and it does exactly the same, works on one host but not another.

Regards

Jason</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#42</link>
      <pubDate>2007-11-26 07:32:56</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#42</guid>
    </item>
    <item>
      <title>Codeassembly</title>
      <description>Hi Jason, I had complains about this problem from other users, there is no php module requirement, I didn't discover the cause that is producing this problem.
I just retested my script and it works fine, I'm using php 5.2.4 with apache on linux for my tests, but I think it works fine on older versions to.</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#41</link>
      <pubDate>2007-11-26 07:32:29</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#41</guid>
    </item>
    <item>
      <title>Jason</title>
      <description>Hi,

I have tried using the above on two different hosts - both are running php v5.

On one host, the menu displays perfectly but on the other it only ever shows the first 'parent' and first 'child'.

Is there a specific PHP Module that needs to be enabled for this menu to work? (hosts question not mine :-))

Many thanks

Kind Regards

Jason</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#39</link>
      <pubDate>2008-03-21 14:02:43</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#39</guid>
    </item>
    <item>
      <title>dod</title>
      <description>thanks for the clear way you have put this tut together.
just the facts none of the crap.
I like how you mainly focused on what we really want to know, the php</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#32</link>
      <pubDate>2007-11-12 07:31:30</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#32</guid>
    </item>
    <item>
      <title>Jason</title>
      <description>The css version doesn't seem to function as per your example i.e. the first item in the menu has href link but should be just text?

Hope that makes sense - great tutorial though :-)

Regards

Jason</description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#16</link>
      <pubDate>2007-10-07 08:25:25</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#16</guid>
    </item>
    <item>
      <title>kasp3r</title>
      <description>Thank you very much for your article. It helped me a lot! </description>
      <link>http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#14</link>
      <pubDate>2007-11-19 08:53:07</pubDate>
      <guid isPermaLink="true">http://codeassembly.com/How-to-display-inifinit-depth-expandable-categories-using-php-and-javascript/#14</guid>
    </item>
  </channel></rss>
