Retrieving all entries except who are blocked query
<p>I have following table</p>

<pre><code>id  blocked  blocker
1     2        1
2     4        2
3     xx       xx
4     xx       xx
</code></pre>

<p>Suppose i provide an id 2</p>

<p>1- I want to perform a query in which both first and second result will be output.</p>

<p>I am using following query </p>

<pre><code>$statement = $conn-&gt;prepare('SELECT * FROM blocks WHERE blocker = :blocker OR blocked=:blocked'); 
</code></pre>

<p>WILL THIS WORK?</p>

<p>Now Once I got array of these entries that is </p>

<pre><code>$row = $statement-&gt;fetchAll(PDO::FETCH_ASSOC)
</code></pre>

<p>Note: It must get all the row because I need their alternative values i-e 1 and 4 in above example.</p>

<p>Secondly using above results, I have another table users. I want to perform a query which will get all entries except 1 and 4 (REFER TO TABLE ABOVE) will be output</p>

<pre><code>id  username  password etc
1
2
3
4
</code></pre>

<p>How can I perform these two queries without using much server resources.</p>
