Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel whereRaw

$Query = DB::table('some_table')->where('YEAR(date)', 'YEAR(CURRENT_DATE)');
SELECT * FROM `some_table` WHERE `YEAR(date)` = `YEAR(CURRENT_DATE)`
  
$Query = DB::table('some_table')->whereRaw('YEAR(date) = YEAR(CURRENT_DATE)');
SELECT * FROM `some_table` WHERE YEAR(date) = YEAR(CURRENT_DATE)
 
PREVIOUS NEXT
Tagged: #laravel #whereRaw
ADD COMMENT
Topic
Name
6+2 =