PHP selecting from db to display username?
<p>So I'm trying to select the username from the users table BASED ON if they are in a gang.</p>

<p>Vars used.: </p>

<pre><code>$member_gang = mysql_fetch_assoc(mysql_query("SELECT level,gangid,rating FROM user_stats WHERE id = '" . $_SESSION['user']['id'] . "'"));
$gang_info = mysql_fetch_assoc(mysql_query("SELECT * FROM gangs WHERE id = '".$member_gang['gangid']."'"));
</code></pre>

<p>And here's when I want to display it.</p>

<pre><code>$getmembers = mysql_fetch_assoc(mysql_query("SELECT * FROM user_stats WHERE gangid = '" . $gang_info['gangid'] . "'"));

$displaymembers = mysql_fetch_assoc(mysql_query("SELECT * FROM users WHERE id = '" . $getmembers['id'] . "'"));

echo 'One Member of this gang is: &lt;b&gt;'.$displaymembers['username'].' &lt;/b&gt;:)';
</code></pre>

<p>(I do have db connection etc..) It's not echoing the username?!</p>

<p>EDIT: I am not that good at PHP, i don't understand prepared statements?</p>
