using variables in WHERE, OR clause

using variables in WHERE, OR clause

crush123crush123 Posts: 417Questions: 126Answers: 18

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

Answers

This discussion has been closed.