Matt Matt - 1 year ago 307
SQL Question

CURDATE() with laravel 5

I'm new to laravel and i am wanting to use multiple where clauses and use curdate().

This is an example :

$data = DB::table('toutcome')->where('date', '>=', curdate())->where('Status', '=', 'A')->count('AppID');

return view('home', compact('data'));

It's not working at all.

Answer Source

Change where('date', '>=', curdate()) to whereRaw('date >= curdate()')

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download