title: Having trouble accessing a table with my SQL query. Not getting the desired result
body: <p>I'm having trouble displaying setid's from the table 'sets' with my SQL query. I'm only receiving setid's from 'inventory', not from 'sets'. </p>
  
  <pre><code>$setidquery = "SELECT inventory.itemid,
                          inventory.setid,
                          inventory.colorid,
                          inventory.itemtypeid,
                          colors.colorname,
                          parts.partname,
                          parts.partid,
                          sets.setid
                          FROM inventory
                          JOIN parts ON inventory.itemid = parts.partid
                          JOIN colors ON inventory.colorid = colors.colorid
                          JOIN sets ON sets.SetID = inventory.SetID
                          WHERE sets.setid = '$_COOKIE[setid]'
                          ORDER BY partname ASC
                          LIMIT 1000";
  </code></pre>
  
  <p>'$_COOKIE[setid]' is a search from a previous stage, so as you can probably guess, that will be the specific 'SetID'. But when enter a setid from the table sets, nothing shows up. </p>
  
  <p>For example the set 375-2 shows up fine, because that set is in the table inventory, but the set 0011-2 does not show up, because that one is in the table sets. </p>
  
  <p>Database scheme: <a href="http://weber.itn.liu.se/~stegu76/TNMK30-2016/legodatabasen.pdf" rel="nofollow noreferrer">http://weber.itn.liu.se/~stegu76/TNMK30-2016/legodatabasen.pdf</a></p>
  
  <p><strong>Goal: To print a table with sets from both inventory and sets.</strong></p>
  
  <p>Sorry for repeating myself a lot, just trying to be specific. </p>