Bhuvnesh Pratap Bhuvnesh Pratap - 1 year ago 87
MySQL Question

Search value in multiple column according to below query using laravel query builder?

Please let me clear about the syntax.My question is that ,How to write the below query

Laravel 4.2
query builder?

SELECT * FROM table WHERE 123 IN (col1, col2, col3, col4);

How to write query in Laravel 4.2? In that i have to search
in multiple column.

Answer Source

Try this

DB::table('table')->whereRaw('123 in (col1, col2, col3, col4));


If you made model for the tabel

table::whereRaw('123 in (col1, col2, col3, col4));
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download