common Posted October 31, 2009 Share Posted October 31, 2009 Hi everyone I have a databse and in one of the columns I have date values such as 2009-March-27. If i have a php interface and want to use a query to select all the rows that is in say october. how would the query look like?? Because i know how to check the whole date, but I want a query that only checks the months... Please help! Thanks Link to comment https://forums.phpfreaks.com/topic/179720-php-mysql-and-date/ Share on other sites More sharing options...
cags Posted October 31, 2009 Share Posted October 31, 2009 If your database column was of type date then you could have used something like... SELECT * FROM table WHERE MONTH(date)=3 ... not sure that will work with the format you have though. You could use LIKE I suppose... SELECT * FROM table WHERE date LIKE '%March% ... not tested it though, just an idea. Link to comment https://forums.phpfreaks.com/topic/179720-php-mysql-and-date/#findComment-948267 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.