How to get current month data in MySql PHP ?By Hardik Savani | March 17, 2016 | | 3708 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);
- Laravel 5 Twitter OAuth using Socialite Package
- Laravel 5 - Multiple Images Uploading using dropzone.js example with demo
- Laravel 5 Facebook authentication using Socialite Package
- How to set multiple selected value in Chosen Jquery Plugin?
- PHP Script - Login with Facebook using facebook-php-sdk and MySQL example with demo
- How to create ban/revoke user functionality in Laravel 5 example ?
- Laravel 5 select with sum query example
- Jquery notification popup box example using toastr JS plugin with demo