How to get current year rows using MySql Query PHP?

How to get current year rows using MySql Query PHP?

In this post we will give you information about How to get current year rows using MySql Query PHP?. Hear we will give you detail about How to get current year rows using MySql Query PHP?And how to use it also give you demo for it if it is necessary.

If you require to get all the records of current year 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 year. 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 year.

Example:

Also see:How to get last 2 days records from table using Mysql Query?

SELECT * FROM items WHERE created_at > DATE_SUB(NOW(), INTERVAL 1 YEAR);

Hope this code and post will helped you for implement How to get current year rows using MySql Query PHP?. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs

For More Info See :: laravel And github

Leave a Comment

Your email address will not be published. Required fields are marked *

  +  31  =  40

We're accepting well-written guest posts and this is a great opportunity to collaborate : Contact US