Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

laravel whereRaw

use IlluminateSupportFacadesDB;

$first = DB::table('users')
            ->whereNull('first_name');

$users = DB::table('users')
            ->whereNull('last_name')
            ->union($first)
            ->get();
Comment

PREVIOUS NEXT
Code Example
Php :: php carbon convert string to date 
Php :: laravel carbon first day of month 
Php :: php convert number to month 
Php :: get type of variable php 
Php :: laravel eloquent get 3 months 
Php :: forever loop php 
Php :: php sessions 
Php :: curl php post 
Php :: php check weekday of date 
Php :: php replace multiple spaces end chrters to one 
Php :: code php ajout heure 
Php :: asset not working in laravel 
Php :: Composer detected issues in your platform: Your Composer dependencies require a PHP version "= 8.0.2". 
Php :: convert comma separated number to number in php 
Php :: create new laravel project cmd 
Php :: php convert special characters to unicode 
Php :: Your Composer dependencies require the following PHP extensions to be installed: curl 
Php :: php how to rename a file before saving it 
Php :: change php version using htaccess 
Php :: insert timestamps manually in laravel 
Php :: acf get user form field 
Php :: How to create an array from a CSV file using PHP 
Php :: laravel blade get authenticated user email 
Php :: start php session 
Php :: display all custom post type ids 
Php :: php get object keys 
Php :: why laravel site loading only 
Php :: mysql count rows php 
Php :: laravel hasfile 
Php :: how to run php file in xampp 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =