dynamic where clause server side
dynamic where clause server side
mm789000
Posts: 25Questions: 2Answers: 0
in DataTables
Hi,
How can i do a dynamic where clause ?
I have a form with search fields , and i want to construct the where clause only with populate fields.
Regards.
Replies
I try something like this :
->where( function ( $q ) use ( $sql_dyn ) {
$q
->where( 'my_table.flag','O' ,'='.$sql_dyn );
} )
But doesn't work.
I found a way like this ( like clause on every search fields ) :
it work. But i'm not really please because it is a big table.
Regards
Why are you not pleased with it? If you want a
LIKE %term%
search, then that is the correct way to do it.Allan