Select all my and my friend friends except us both SQL
<p>I have thee tables "user_follow", "images", "users"</p>

<p>My user_id : 3
My Friend user_id : 6</p>

<p>I need query to select all friends of me and my friend with their username and images
1) do not show us each other
2) duplicate friends show as 1</p>

<p>My query is : </p>

<pre><code>    $sql = "SELECT u.username, i.image, u.id
            FROM users u
            LEFT JOIN user_follow f ON u.id = f.follow_id
            LEFT JOIN images i ON u.id = i.user_id
            WHERE f.user_id = 6 OR f.user_id = 3
            GROUP BY u.id
            ORDER BY f.date DESC";
</code></pre>

<p>and result is :</p>

<pre><code>[user_both_follow] =&gt; Array
    (
        [0] =&gt; Array
            (
                [username] =&gt; Kolxoznik1
                [image] =&gt; 
                [id] =&gt; 1
            )

        [1] =&gt; Array
            (
                [username] =&gt; 7777
                [image] =&gt; 
                [id] =&gt; 8
            )

        [2] =&gt; Array
            (
                [username] =&gt; 6666
                [image] =&gt; flw3utn9igiqh7dtt2o61ydf8_174.jpeg
                [id] =&gt; 6
            )

        [3] =&gt; Array
            (
                [username] =&gt; 8888
                [image] =&gt; 
                [id] =&gt; 7
            )

    )
</code></pre>

<p>My query works at 50% it group the same friends but problem is that show my friend 3->6 (show)</p>
