How to fetch this week records in MySql ?By Hardik Savani | February 28, 2016 | | 1007 Viewer | Category : PHP MySql
Share this post:
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 - elasticsearch with pagination example
- How to get product using rakuten marketing api in PHP?
- How to use bootstrap colorpicker example code
- Mysql Hexadecimal color code store in binary datatype.
- PHP - How to implement Google new reCAPTCHA Code Example with Demo?
- Laravel 5 custom pagination view example
- PHP - How to convert HTML file to PDF using Dompdf library?
- How to remove empty values from array in PHP?