title: SQL select item from one table that is not in another
body: <p>I have a php page with a variable $lid, and a user with vairable $uid... I need to select some data from 2 tables to fill out the page. </p>
  
  <pre><code>        Table 1                          Table 2
  ¦----------¦----------¦    ¦----------¦----------¦----------¦
  ¦    qid   ¦    lid   ¦    ¦   owner  ¦   qid    ¦timestamp ¦
  ¦----------¦----------¦    ¦----------¦----------¦----------¦
  </code></pre>
  
  <p>I need to write an SQL statement that gets everything from table 2 where the owner = $uid if the qid is not already listed in table1 with the current pages' $lid.</p>
  
  <p>I tried</p>
  
  <pre><code>SELECT * FROM table_two WHERE qid != (SELECT qid FROM table_one WHERE lid = " . $lid .") AND owner = " . $uid . ";
  </code></pre>
  
  <p>But had no joy</p>
  
  <p>Any ideas?</p>