XF 2.2 Or condition on finder

forumSolution

Active member
Hey,

I want to write a query on xenforo that will have both operator AND , OR .

If i use $item->where() then it will use only AND .. but if use $item->where()->whereOr(). Then it will wrap all OR condition in AND .


Is there anyway i can write something like that .

Select * from zyx where abc=1 and zzz=2 and bbb=3 or rrr in(10)

Please guide me

Thanks
 
You can create arbitrary conditions with whereSql, but IIRC whereOr should also work for your usecase:

Code:
whereOr([['abc', 1], ['zzz', 2], ['bbb', 3]], ['rrr',  [10]])
 
Back
Top Bottom