How do you match multiple fields against multiple words using AND?
Say I want to find everyone with firstname, lastname, email, address, city, employer, key words (which I forgot to add), etc. of 'Smith', but also against '416' to match every phone_home, phone_cell, etc of people living in Toronto. But it could be searching all the different database fields, not just phones or postal codes.
I want to only find records where all of the words match the record in one field or another, thanks.
$to_search = mysql_real_escape_string($contacts->search);
$query = "SELECT *, MATCH
(firstname, lastname, phone_home, phone_cell, phone_fax, email, address, city, province_state, postal_code, country, employer, job_title)
AGAINST ('$to_search') AS score FROM contact_info WHERE MATCH
(firstname, lastname, phone_home, phone_cell, phone_fax, email, address, city, province_state, postal_code, country, employer, job_title)
AGAINST ('$to_search') ORDER BY $contacts->sort_by $contacts->sort_ord LIMIT $contacts->max_list";
Is currently only looking for any field with either 'Smith', 'AND', or ' 416'.