want to fetch from the db

I want to fetch data from the db using date. My date format is yr/m/Dy. 1. i want to fetch data for a particular day. 2. data for a particular week 3. data for a particular month 4. and data for a particular year.

So your date format is 12/10/18? You should not store the date like this. Use a standard DATE or DATETIME field then convert it to the format you need using the DATE_FORMAT() function. You could also store a timestamp which can be converted to your format using FROM_UNIXTIME()

Sponsor our Newsletter | Privacy Policy | Terms of Service