Editor multiple ->where clause with OR instead of AND
Editor multiple ->where clause with OR instead of AND
fabioberetta
Posts: 74Questions: 23Answers: 4
Dear all,
I am using the ->where clause in the PHP library and works perfectly.
Now if you use multiple where it assumes and AND between them.
I need to use an OR. I do not find any examples or reference for that.
Is it possible to have an OR? How?
ty
f
This question has accepted answers - jump to:
This discussion has been closed.
Answers
Hi,
Yes, this can be done - have a look at the conditions documentation for the PHP libraries which have examples of how an OR condition can be applied.
Regards,
Allan
Thanks allan,
it worked! Great product and even better support.
I would need now an advice from you. I have this relatively complex mysql query.
Shall I try to pass it to the server using your editor methods or do you have any passthrough function?
I am a bit reluctant due to the complexity of the query.
ty
f
I forgot to mention that I wont need to use the editor. Just properly show the data into a datatable.
ty
f
I found out in your manual a reference to
$db->sql()
that is supposed to allow execution of own query but I do not really understand how to use it. Do you have an example?
ty
f
Yes - you can simply do:
to get the results from your own query.
The query above is a little bit beyond what the Editor libraries can do at the moment I'm afraid, but the
sql()
method will accept any SQL.Allan
Thanks Allan,
Since I just needed to have a joson to be diplayed in a datatable I ended up with doing the following:
I put an example below if someone needs to do the same.
Thanks,
f
Sounds good - thanks for posting your solution.
Allan