title: Search database whilst filtering out posts that don't have images
body: <p>I have 3 tables, something like this (only posting relevant info):</p>
  
  <pre><code>USER:
  -----
  user_id
  
  POST:
  ----
  post_id
  user_id
  
  IMAGE:
  ----
  image_id
  post_id
  </code></pre>
  
  <p>What I am trying to do, is allow a user to search for posts, they can choose whether or not the post results include images or not.</p>
  
  <p>So it'll be something like:</p>
  
  <pre><code>if ($images_selected) { $SQL_TO_FIND_POSTS_WITH_IMAGES; } else { $SQL_TO_FIND_POSTS_WITHOUT_IMAGES; }
  </code></pre>
  
  <p>Having a lot of trouble getting my head round how I will do this.</p>
  
  <p>Cannot change any table structure as it must be this way.</p>