Tag : DATE_SUB


How to get current month data in MySql PHP ?

If you require to get all the records of current month using mysql query. for example you have one table "items" and columns are id, title, description, created_at and update_at, Now you want to get all records of this month. so you can fetch fields value using DATE_SUB and INTERVAL of mysql. In following example you can see how to select data of current month. <strong class="example">Example:</strong> <pre class="language-mysql">SELECT * FROM items WHERE created_at > DATE_SUB(NOW(), INTERVAL 1 MONTH);</pre>

By Hardik Savani | March 17, 2016 | | 3970 Viewer | Category : PHP MySql
READ MORE

    Laravel 5.3 - whereDate(), whereMonth(), whereDay() and whereYear() examples.

    Laravel 5.3 - whereDate(), whereMonth(), whereDay() and whereYear() examples.

    Open Post

    How to create custom facade in laravel 5.2?

    How to create custom facade in laravel 5.2?

    Open Post

    Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 2

    Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 2

    Open Post

    Laravel 5 Redirect to URL using redirect() helper

    Laravel 5 Redirect to URL using redirect() helper

    Open Post

    How to send mail using zoho smtp server in PHP Laravel?

    How to send mail using zoho smtp server in PHP Laravel?

    Open Post

    Laravel 5 export to pdf using maatwebsite example

    Laravel 5 export to pdf using maatwebsite example

    Open Post