$sQuery = '
SELECT DISTINCT SQL_CALC_FOUND_ROWS IF( `Profiles`.`Couple`=0,
`Profiles`.`ID`, IF( `Profiles`.`Couple`>`Profiles`.`ID`, `Profiles`.`ID`,
`Profiles`.`Couple` ) ) AS `ID` FROM `Profiles`';
$sCountries = implode("','", $mValue);
$sJoin .= " LEFT JOIN `hm_locations` ON (`hm_locations`.`country` IN '".$sCountries."'
AND `hm_locations`.`profileID` = `Profiles`.`ID`) ";
This query is gathered different functions then is put together with another function, but I basically want to know how I could re-write the LEFT JOIN section to work properly.
I’m trying to add on my own left join here so that the search will grab IDs from hm_locations where the country matches the search.
I only want help with the LEFT JOIN section because that’s the only part not working.
Thanks alot
You need to put your countries in parenthesis: