You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$sql="SELECT username,id FROM memberstable WHERE username LIKE '%$friend_name%' AND id!='$userId'";
$result=mysqli_query($conn,$sql);
while($row=mysqli_fetch_assoc($result))
{
$un[]=$row;
}
//print_r($un);
//$un=array_unique($un);//removes duplicate entries from the suggestions' array
if(isset($un)){
foreach($un as $u){
$fid=$u['id'];
$fname=$u['username'];
$sql="SELECT id FROM friends_table WHERE ((sender_user_id='$fid' AND receiver_user_id='$userId') OR (sender_user_id='$userId' AND receiver_user_id='$fid')) AND relation=1";