code snippet to display list of friends failing?
<p>I have those code snippet that checks the fans table and gets everyone who has fanned you. It then checks if you have fanned them as well and if so it displays their username and profile picture. </p>

<p>It check if you have fanned them using $count I'm assuming this is where it's tripping up. but firebug isn't showing any errors.</p>

<pre><code>&lt;?php $friendlist = mysql_query("SELECT * FROM fans WHERE username='$user'") or die(mysql_error());
        while($row = mysql_fetch_array($result1)) {
            $friendname = $row['fanned'];
            $friendlist2 = mysql_query("SELECT * FROM fans WHERE username='$friendname' AND fanned='$user'") or die(mysql_error());
            $count = mysql_num_rows($friendlist2);
            if($count == 1 ){
                $avatar = mysql_query("SELECT * FROM users WHERE username='$friendname'") or die(mysql_error());
                while($row3 = mysql_fetch_assoc($avatar)) {
                $filename = $row3['avatar'];
                if($filename != "") { 
                            $friendpic = '&lt;img id="headeravapic" src="profileavatars/' . $friendname . "/" . $filename . '" /&gt;';
                        }
                        else {
                            $friendpic = '&lt;img id="headeravapic" src="images/nopic.PNG" /&gt;';
                        }
        echo '&lt;div align="center" id="onlinepic"&gt;' . $friendpic . '&lt;p /&gt;' . $friendname . '&lt;/div&gt;'; 
                }
            }
        }?&gt;
</code></pre>
