我知道你的問題只有一個解決方案,當然,它不是那麼快,但可行。 您可以檢查用戶在內部友情>>
while($run_friend_two = mysql_fetch_array($friend_query_two)){
$user_one_two = $run_friend_two['user_one'];
$user_two_two = $run_friend_two['user_two'];
if($user_one_two == $friend_id){
$user_two = $user_two_two;
}else{
$user_two = $user_one_two;
}
$friend_id_two = getuser($user_two, 'user_id');
///// check for the existence
$existence = mysql_query("SELECT 'friends_id' FROM 'friends' WHERE (`user_one`='$friend_id_two' and `user_two` = '$session_user_id') OR (`user_one`='$session_user_id' and`user_two`='$friend_id_two')");
if(mysql_num_rows($existence)>0) /// check whether the query get results or not
echo $friend_id_two;
} //end while first
只是用從查詢中排除您的用戶ID'<>' – sikas
任何想法如何做到這一點? – user2491321
無法從這個 – user2491321