Re: [PHP] If MySQL column/field values are in an PHP array

2007-07-20 Thread Richard Lynch
I think you want OR instead of AND in your query... It will be very dificult for both: name+city+state name to be in your list of cen_chiefs... cen_chiefs would have to have *both*: Joe Chicago IL Joe in it, in order for Joe from Chicago, IL to match with AND. OR would get rows where either thei

[PHP] If MySQL column/field values are in an PHP array

2007-07-19 Thread kvigor
I created an array using the following: $in_list = "'".join("','",$cen_chiefs)."'"; //$cen_chiefs is an array $query_cen_chiefs = "SELECT * FROM central WHERE CONCAT(strName,' ',strCity,' ',strState) IN({$in_list})"; How would I go about adding an AND clause to the above query to return all ro