How to fetch this week records in MySql ?By Hardik Savani | February 28, 2016 | | 3878 Viewer | Category : PHP MySql
If you require to get all the records of current week 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 week. 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 week.
SELECT * FROM items WHERE created_at > DATE_SUB(NOW(), INTERVAL 1 WEEK);
- Laravel 5 - Grayscale Image Generate Example from scratch
- How to get Query Strings Value in Laravel 5?
- How to remove # from URL in AngularJS?
- How to delete multiple records using checkbox in Laravel 5 ?
- Laravel 5 - Dynamic Dependant Select Box using JQuery Ajax Example - Part 2
- Laravel 5 manual pagination with array example
- How to add Delete cascade to existing column in Laravel 5, without remove column?
- Laravel 5 select with count query with group by example