How to get current month data in MySql PHP ?By Hardik Savani | March 17, 2016 | | 2985 Viewer | Category : PHP MySql
Share this post:
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.
SELECT * FROM items WHERE created_at > DATE_SUB(NOW(), INTERVAL 1 MONTH);
- How to check uploaded file is empty or not in Laravel 5.3?
- AngularJS tooltip using UI Bootstrap tpls HTML example with demo
- How to remove empty values from array in PHP?
- How to send mail using zoho smtp server in PHP Laravel?
- Laravel 5 - Example of Database Seeder with insert sample data
- PHP - jquery ajax crop image before upload using croppie plugin
- How to add LIKE query in Elasticsearch?
- How to send mail using mailable in laravel 5.3?