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 | | 1050 Viewer | Category : MySql
READ MORE

    Paypal payment gateway integration in php source code example

    Paypal payment gateway integration in php source code example

    Open Post

    AngularJS - scroll to a specific element using anchorscroll

    AngularJS - scroll to a specific element using anchorscroll

    Open Post

    Simple Highcharts Chart Example using PHP MySQL Database

    Simple Highcharts Chart Example using PHP MySQL Database

    Open Post

    laravel 5.4 New Feature - Add eloquent whereKey method

    laravel 5.4 New Feature - Add eloquent whereKey method

    Open Post

    Laravel 5 - Generate Captcha code and Validation example using BotDetect package

    Laravel 5 - Generate Captcha code and Validation example using BotDetect package

    Open Post

    Jquery highlight search text in div using highlight JS with example

    Jquery highlight search text in div using highlight JS with example

    Open Post