Democreous Posted February 4, 2007 Share Posted February 4, 2007 Does anyone know of any good tutorials on ordering mysql queries or using WHERE statements? I'm trying to get a query result that only displays rows with a certain month that is stored as a date (YYYYMMDD) in MySQL and am having a bit of trouble finding any solid info on the subject. Thank you - Brian Link to comment https://forums.phpfreaks.com/topic/37016-ordering-mysql-queries/ Share on other sites More sharing options...
.josh Posted February 4, 2007 Share Posted February 4, 2007 one way: $month = 12; // example $query = "select * from table where column like '____$month__' order by column" Link to comment https://forums.phpfreaks.com/topic/37016-ordering-mysql-queries/#findComment-176718 Share on other sites More sharing options...
Democreous Posted February 4, 2007 Author Share Posted February 4, 2007 Thanks, that's exactly what I needed to know Link to comment https://forums.phpfreaks.com/topic/37016-ordering-mysql-queries/#findComment-176725 Share on other sites More sharing options...
fenway Posted February 5, 2007 Share Posted February 5, 2007 <shudder> Why not use the MONTH() function? Link to comment https://forums.phpfreaks.com/topic/37016-ordering-mysql-queries/#findComment-177204 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.