Tag : Calculate


How to calculate age from date of birth column in mysql?

Sometimes, we require to get age from birthdate using mysql select query, we can do it in programming like php,.net and etc framework but if we can do it using mysql query. In bellow example mysql query you can learn how to get age from date field. We can get age value from using mysql DATEDIFF(). So, let's see bellow query. <strong>Example:</strong> <pre> SELECT id, (DATEDIFF(CURRENT_DATE, STR_TO_DATE(born_date, '%Y-%m-%d'))/365) as age FROM `users` </pre>

By Hardik Savani | June 1, 2016 | | 927 Viewer | Category : MySql
READ MORE

    CRUD (Create Read Update Delete) Example in Laravel 5.2 from Scratch

    CRUD (Create Read Update Delete) Example in Laravel 5.2 from Scratch

    Open Post

    Crop, Resize, Frames etc on selected image in php using Aviary

    Crop, Resize, Frames etc on selected image in php using Aviary

    Open Post

    How to call AngularJS controller function in Jquery?

    How to call AngularJS controller function in Jquery?

    Open Post

    How to create authentication(login and registration) in Laravel 5.2?

    How to create authentication(login and registration) in Laravel 5.2?

    Open Post

    Laravel 5.3 - Customize pagination templates example from scratch

    Laravel 5.3 - Customize pagination templates example from scratch

    Open Post

    Codeigniter 3 - CRUD(Create, Read, Update and Delete) using JQuery Ajax, Bootstrap, Models and MySQL

    Codeigniter 3 - CRUD(Create, Read, Update and Delete) using JQuery Ajax, Bootstrap, Models and MySQL

    Open Post