title: Select data from two tables. one table is parent/child and I need to get the parents without a relation
body: <p>I have two tables</p>
  
  <p>products</p>
  
  <pre><code>id  |  catID  |  UID
  --------------------
  1   |  3      |  3
  </code></pre>
  
  <p>categories</p>
  
  <pre><code>id  |  cat_name  |  parent
  --------------------------
  2   |  XYZ       |  0
  3   |  abc       |  2
  </code></pre>
  
  <p>I need to pull each product and its related category AND that categories related parent based solely on the id of the product....</p>
  
  <p>I have tried a couple of variations but can not quite get the parent categories into the fetch. There is no relationship for parent categories in the products table.</p>
  
  <pre><code>SELECT
    a.product_name, a.catID, b.cat_name, b.parent
  FROM
    products a, categories b
  WHERE
    a.id = '$_SESSION[spid]' 
    AND b.id = a.catID
    OR b.id = b.parent /// not correct..
  </code></pre>