How to get current month data in MySql PHP ?By Hardik Savani | March 17, 2016 | | 8710 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);
- JQuery - Display loading image on ajax call example
- Laravel 5 File(Image) Upload Example with Validation
- Laravel 5 dynamic autocomplete search using select2 JS Ajax - Part 1
- How to connect mysql database in node js with example?
- Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
- Jquery ajax request example
- How to Uninstall a Package in Laravel 5 Using Composer Command?
- HTML tags are not allowed in textbox validation using Jquery