using variables in WHERE, OR clause
using variables in WHERE, OR clause
I am using editor to generate an ajax json source and i want to pass in 2 parameters into my where clause.
If i used fixed values, then everything works ok, but I cannot pass in parameters
so my where clause looks like this...
->where( function ( $q ) {
$q
->where('tblorders.OrderEmail', 'fixed value 1')
->or_where('tblorders.OrderCompany', 'fixed value 2');
} )
and I want it to do something like this
->where( function ( $q ) {
$q
->where('tblorders.OrderEmail', $variable1)
->or_where('tblorders.OrderCompany', $variable2);
} )
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I think I have managed to do this using a sub-select
https://editor.datatables.net/manual/php/conditions#Or-operators-and-grouping