title: How to create a nested menu from MySQL with PHP?
body: <p>I need to create a menu with PHP from a MySQL database. </p>
  
  <p>Table called categories has id, name, parent_id, shortdesc, etc.</p>
  
  <p>The output need to have parent list and children list under the partent list as follows.</p>
  
  <p>If you can show me codes or website, I will appreciate it.</p>
  
  <pre><code>&lt;ul id="catmenu"&gt;
      &lt;li class="menulist"&gt;Cars
          &lt;ul&gt;
              &lt;li&gt;Ford&lt;/li&gt;
              &lt;li&gt;Honda&lt;/li&gt;
              &lt;li&gt;Toyota&lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li class="menulist"&gt;Food
         &lt;ul&gt;
              &lt;li&gt;Pasta&lt;/li&gt;
              &lt;li&gt;Pizza&lt;/li&gt;
              ...
         &lt;/ul&gt;
      &lt;/li&gt;
  ...
  ...
  &lt;/ul&gt;
  </code></pre>