title: How to JOIN category table for parents in SQL query?
body: <p>I have a table for posts as (id, category_id, ...), then <code>JOIN</code> it with the category table as (category_id, category_name, parent, ...) ON <code>category_id</code>. Parent is the category_id of another category. For example:</p>
  
  <pre><code>category_id    category_name      parent
  1              Computer Science   NULL
  2              Web Technology     1
  3              Mathematics        NULL
  4              PHP                2
  </code></pre>
  
  <p>How can I <code>JOIN</code> posts and category tables to read parent categories of a post too. For example, </p>
  
  <pre><code>id     category_id    post_title
  44     4              something
  </code></pre>
  
  <p>With simple <code>JOIN</code> ON category_id, I can get only PHP as category; how can I get the parents too as <code>Computer Science &gt; Web Technology &gt; PHP</code> ?</p>
  
  <p><strong>NOTE:</strong> I use mysql with MyISAM engine.</p>