Using an IN query, I am able to pass something like this to my
database to get the values that match at least one of the array
values.
SELECT * FROM contacts WHERE (work_lat != '' and work_long != '' and
id in (select tutor_id from subjects_tutors where subject_id in
(17,18,22,26,27,35))) AND ( (contacts.`type` = 'Tutor' ) )
What I need to do is have the query search for results that match all
array values. In other words, in the example above I need a tutor who
matches subject_id 17,18,22,26,27 and 35. The data model is for a
Ruby on ...
Bookmarks