Search
 
SCRIPT & CODE EXAMPLE
 

PHP

How to calculate age using query builder in laravel?

You can use selectRaw and then use mysql function like this

$user_info = DB::table('users')
                ->selectRaw("TIMESTAMPDIFF(YEAR, DATE(dob), current_date) AS age")
                ->get();
Comment

PREVIOUS NEXT
Code Example
Php :: static functions php 
Php :: php jwt firebase 
Php :: Declaration of AppExportsTarefasExport::headings() must be compatible with MaatwebsiteExcelConcernsWithHeadings::headings(): array 
Php :: phpdoc array of strings 
Php :: codeigniter AES _ENCRYPT or AES_DECRYPT in where 
Php :: yii2 modules commands are not showing in console 
Php :: shorthand to assign multiple variable to same value in php 
Php :: count letters in string without space or characters and numbers in php 
Php :: how to get textbox value in php without submit 
Php :: Agregar clases de rol al body en WordPress 
Php :: phpcs unabl 
Php :: pengulangan php 
Php :: laravel join with count 
Php :: remove database in codeigniter 
Php :: Warning: Undefined array key "index_no" in C:xampphtdocs ruestudent eports.php on line 54 Fatal error: Uncaught TypeError: mysqli_fetch_array(): 
Php :: exceptions on fatals(2) 
Php :: phpmyadmin account locked 
Php :: Obtener rol de usuario registrado en WordPress 
Php :: view codeigniter 4 
Php :: convert php array into json online 
Php :: laravel join query taking too long 
Php :: https://www.codegrepper.com/documentation.php 
Php :: ifmodule condition in htaccess 
Php :: wordpress add menu frontend 
Php :: sync fetch eloquent laravel 
Php :: laravel get limited character of string 
Php :: php array_walk_recursive 
Php :: php receive get 
Php :: after jquery validation ajax call in php 
Php :: magento 2 isSetFlag() 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =