title: Creating a list tree with SQLite
body: <p>I'm trying to make a hierarchical list with PHP and an SQLite table setup like this:</p>
  
  <pre><code>    |   itemid  |   parentid    |   name    |
      -----------------------------------------
      |   1       |   null        |   Item1   |
      |   2       |   null        |   Item2   |
      |   3       |   1           |   Item3   |
      |   4       |   1           |   Item4   |
      |   5       |   2           |   Item5   |
      |   6       |   5           |   Item6   |
  </code></pre>
  
  <p>The lists would be built with unordered lists and allow for this type of tree structure:</p>
  
  <pre><code>Item1
      |_Item3
      |_Item4
  Item2
      |_Item5
          |_Item6
  </code></pre>
  
  <p>I've seen this done with directories and flat arrays, but I can't seem to make it work right with this structure and without a depth limit.</p>