title: Selecting a mysql row from one table based on select statement in another
body: <p>I am trying to select a tshirts which the user has not voted on yet (from another table "votes")</p>
  
  <p>"submissions" is the table with the tshirts</p>
  
  <p>"votes" is the table that holds votes</p>
  
  <p>"votes" structure is: ID, TEE, USER (where votes.tee == submissions.id)</p>
  
  <p>This is the mysql statement I am trying:</p>
  
  <pre><code>SELECT 
    submissions.name,
    submissions.id,
    submissions.uploader,
    submissions.image_vote
   FROM 
    submissions,votes 
   WHERE 
    submissions.date_voted IS NOT NULL AND
    submissions.id NOT IN (SELECT tee FROM votes WHERE tee=submissions.id AND user='3')
   LIMIT 1  
  </code></pre>
  
  <p>Now from what I understand I cannot use "tee=submissions.id" because it is from a query outside of this sub query. So how can I pass the sub query the ID of the tshirt I am checking?</p>
  
  <p>Thank you.</p>