How to get current month data in MySql PHP ?By Hardik Savani | March 17, 2016 | | 4410 Viewer | Category : PHP MySql
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 Google OAuth authentication using Socialite Package
- How to solve "Cannot find module 'bplist-parser'" ?
- How to change date format in jquery using moment JS ?
- How to get current controller or method name in Codeigniter ?
- Ckeditor required field validation example in Jquery
- PHP Image upload without refreshing page using jquery example
- Laravel 5 clear cache from route, view, config and all cache data from application
- How to convert line breaks to br in jQuery ?