piyush23424 Posted November 19, 2010 Share Posted November 19, 2010 Hi, pls read carefully. I want to fetch data from database for a particular day occurrence in month, year. eg. if i query the database with 5. Then it should fetch all the records added on day 5th day of the month, doesn't matter whatever the month is and year. Just wanted all the records added on 5th day of any month-year in database. Note: date field is saved as date(datatype) in database Pls write a query to fetch data for this problem. Pls Reply. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/219246-fetch-record-for-a-particular-day/ Share on other sites More sharing options...
piyush23424 Posted November 19, 2010 Author Share Posted November 19, 2010 I have found the solution of this problem... We can do this using LIKE statement. $day = 05; $qry = "select * from table_name where date LIKE '%-%-$day'"; Thats it. Quote Link to comment https://forums.phpfreaks.com/topic/219246-fetch-record-for-a-particular-day/#findComment-1136956 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.