title: Excluding Row From MySQL Query If ID is Blocked
body: <p>I'm sure this is MySQL 101 and I apologise if the answer is simple, but I'm a little stuck so here I am.</p>
  
  <p>I have a table of users, named 'site_members' with various fields but importantly, each with a unique id.</p>
  
  <p>I also have a very simple two-field table, named 'blocked_members' which contains the id's of users who have been blocked by the logged in user, which is simply set up to store the user id of the person blocked, and the user id of the blocker:</p>
  
  <pre><code>Field 1 | Blocked
  Field 2 | Blocker
  </code></pre>
  
  <p>Before I run a query on the 'site_members' table, I run a query on the 'blocked_members' table to find out if the current logged in user appears in either column:</p>
  
  <pre><code>$sql = "SELECT * FROM blocked_members WHERE blocker = '$loggedin_id'  OR blocked = '$loggedin_id' ";
  </code></pre>
  
  <p>What I need to do next is get the corresponding user id from each row the logged in user's id appears in, and exclude that(those) from my main query on the 'site_members' table, but I do not know how I would go about this?</p>
  
  <p>Can anyone help or point me in a cleaner direction?</p>