[eluser]Kyle Ellman[/eluser]
Hello, I am having some issues using the active record class to do a search on some users in a database.
I need to use multiple "where" clauses and multiple "like" clauses.
The "where" clauses are all mandatory as they are flags that all need to be a certain way.
I want to take any matches from any of the "like clauses," so I need to use the or_like functions on all but one of them, I think. The problem is that as soon as I use an or_like, it renders my "where" clauses useless.
Essentially, I think it's doing this:
(where f1 equals s1 AND where f2 equals s2 AND f3 isLike s3
) OR f4 isLike s4
But I need it to do this:
(where f1 equals s1 AND where f2 equals s2
) AND
(f3 isLike ss32 OR f4 isLike s4
)
(I know, the SQL syntax is wrong, but hopefully I got the point accross)
Does anyone have any ideas?
Thanks.