我想将 if 语句中产生的所有 use_id_one 值存储在一个数组中。知道怎么做吗?
$query = mysql_query(" SELECT `user_id` FROM users WHERE (surname LIKE '$name%' AND name LIKE '$surname%') OR (surname LIKE '$surname%' AND name LIKE '$name%') ");
while($run = mysql_fetch_array($query)){
$user_id_one = $run['user_id'];
$check_friend_query = mysql_query(" SELECT friends_id from friends WHERE (user_one='$session_user_id' AND user_two ='$user_id_one') OR (user_one='$user_id_one' AND user_two='$session_user_id') ");
if( mysql_num_rows($check_friend_query) == 1 ){
echo"$user_id_one";
//the above echo prints me all user_id_one values I want
//how to store all these values of user_id_one in an array
}
}
以及接下来如何输出它们,以确保存储的正确性(用于测试目的)