Gathering value from one table and using it in second query?
<p>Okay this is going to sound dumb, however having some difficulties on the best way of doing this; I'm trying to grab all the users that an account is following; then once I've grabbed all the users I'm following from the following table grab the user information for the users table. this is what I have so far but It's really messy and non working. </p>

<pre><code>&lt;?
$usr_id = '34';

$sql = "SELECT * FROM following WHERE usr_id = '$usr_id'";
$result = mysql_query($sql);
// $following is the users that we are following.
while ($row = mysql_fetch_assoc($result)) {

        $following = $row['following'];

$src = "SELECT * FROM usr_users WHERE username = '$following'";
$getfollowinginfo = mysql_query($src);

while ($user = mysql_fetch_assoc($getfollowinginfo)) { 

        echo $user['email'];

}}
?&gt;
</code></pre>