I am ruing the following queries on my SQL databases. What I want to do next is to remove all the users from $result_users whose user_ID is also a receiverID in the $result_sender array. To do so I have created the following code, however I am not sure if my approach is correct. I have found online that what should be done is unset($array[$key]), however all the examples I found were normal arrays, and not obtained from SQL databases, hence I'm not sure how to proceed in this situation
$retrieve_potential_matches_sender = mysqli_query($co,"SELECT senderID, receiverID FROM match_instance WHERE senderID = '$sender'");
$retrieve_all_users = mysqli_query($co,"SELECT user_id, sex, latitude, longitude FROM users_with_fb");
$result_sender = mysqli_fetch_array($retrieve_potential_matches_sender);
$result_users = mysqli_fetch_array($retrieve_all_users);
if count($result_sender) > 0 {
foreach ($result_sender as $sendingID) {
foreach ($result_users as $userValue) {
if ($userValue["user_id"] == $sendingID["receiverID"] {
unset($userValue);
}
}
}
