title: Generating nested tree with full paths (URLS) and values from the database
body: <p>I work on this issue since yesterday. More specifically - I have some values ​​in the database, which look as follows:</p>
  
  <pre>
  ____________________________________
  | id | parentId |   name   |  url  |
  ------------------------------------
  | 1  |     0    | Nieuws   | url_1 |
  ------------------------------------
  | 2  |     0    | Reviews  | url_2 |
  ------------------------------------
  | 3  |     0    | Meuk     | url_3 |
  ------------------------------------
  | 4  |     1    | Games    | url_4 |
  ------------------------------------
  | 5  |     1    | Internet | url_5 |
  ------------------------------------
  | 6  |     5    | Browsers | url_6 |
  ------------------------------------
  
  </pre>
  
  <p>I would like to see generated tree on the basis of these values. Target shape should look like this:</p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;&lt;a href="url_1"&gt;Nieuws&lt;/a&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;a href="url_1/url_4"&gt;Games&lt;/a&gt;&lt;/li&gt;
              &lt;li&gt;&lt;a href="url_1/url_5"&gt;Internet&lt;/a&gt;
                  &lt;ul&gt;
                      &lt;li&gt;&lt;a href="url_1/url_5/url_6"&gt;Browsers&lt;/a&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/li&gt;
          &lt;/ul&gt;
      &lt;/li&gt;
      &lt;li&gt;&lt;a href="url_2"&gt;Reviews&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href="url_3"&gt;Meuk&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p>It's important for me to have all the slashes inside the tree (full path with all the parents &amp; children).</p>
  
  <p>I would like to add, that I found the code on this page: <a href="http://crisp.tweakblogs.net/blog/317/formatting-a-multi-level-menu-using-only-one-query.html" rel="nofollow">http://crisp.tweakblogs.net/blog/317/formatting-a-multi-level-menu-using-only-one-query.html</a> but I can not redo it in such a manner as described above. I'll be very grateful for any help, because the application deadline is approaching very fast :(</p>