I have a php code and I like to print those who are not user’s friend in a list. But I just can print out all user except user himself..Any advice for this problem? Thanks for reply.
testList.php
$name = $_POST['Username'];
$data=mysql_query("SELECT * FROM User");
$dataA = mysql_query("SELECT * FROM Friends WHERE responseRequest='$name' AND status='approved'");
$dataB = mysql_query("SELECT * FROM Friends WHERE sentRequest='$name' AND status='approved'");
while($info = mysql_fetch_array( $data ))
{
if($info['username']==$name){
continue;
}
while($friend1 = mysql_fetch_array($dataA)){
if($info['username']==$friend1['sentRequest']){
continue;
}
}
while($friend2 = mysql_fetch_array($dataB)){
if($info['username']==$friend2['responseRequest']){
continue;
}
}
Print $info['username']."*";
}
mysql_close();
here are the tables from mysql database:
User:

Friends

You should really encrypt the passwords that are in the database, as now anyone whop sees those images has access to those accounts.
When inserting into the database, use something like: