I'm trying to return multiple values so I can get the first and last name of everyone that's your "friend"
here's a look at the new code that I was trying to use.
if (isset ($_POST['submitted'])) { //check if form is submitted
$id = $_POST['mid'];
$q = "SELECT first_name, last_name FROM users WHERE user_id=(SELECT f_id FROM friends_junction WHERE m_id='$id');"; //subselect query
$r = mysqli_query ($dbc, $q);
while ($row = mysqli_fetch_array ($r, MYSQLI_ASSOC)) { //as long as there are records
echo '' . $row['first_name'] . ' ' . $row['last_name'] . ' is your friend!';
}//end of while
} //end of if submitted
echo '<div>
<form action ="test_friends.php" method="post">
<input type="text" size="15" maxlength="20" name="mid" value="" />
<input type="submit" name="submit" value="SUBMIT" />
<input type="hidden" name="submitted" value="TRUE" />
</form>
</div>';
include ('includes/footer.php');
?>
here's the structure of the friends_junction table, it's just a 1 to 1.
m_id | f_id
3 | 4
3 | 5
3 | 6
Any help would be awesome, thanks!