I'm trying to eliminate some items in an array by checking some other profile information in the database matching the user id's.
function filterSexMatches($sSex, $aMatchIds){
foreach($aMatchIds as $iMatchId){
$aMatches[] = $this->getOne("SELECT `ID` FROM `Profiles` WHERE `ID` = '{$iMatchId}' AND `Sex` != '{$sSex}'");
}
return $aMatches;
}
This is my function but it returns an empty id value when the Sex doesn't match and adds it to the $aMatches array.
I want to know how I can change this to skip over the user id if the Sex field matches so it doesn't return an empty iteration.