php - MySQL left join problem -
$squery = ' select distinct sql_calc_found_rows if( `profiles`.`couple`=0, `profiles`.`id`, if( `profiles`.`couple`>`profiles`.`id`, `profiles`.`id`, `profiles`.`couple` ) ) `id` `profiles`'; $scountries = implode("','", $mvalue); $sjoin .= " left join `hm_locations` on (`hm_locations`.`country` in '".$scountries."' , `hm_locations`.`profileid` = `profiles`.`id`) ";
this query gathered different functions put function, want know how re-write left join section work properly.
i'm trying add on own left join here search grab ids hm_locations country matches search.
i want left join section because that's part not working.
thanks alot
you need put countries in parenthesis:
"... `hm_locations`.`country` in ('".$scountries."') ..."
Comments
Post a Comment