Miko Posted December 23, 2009 Share Posted December 23, 2009 Hello! I making an SQL statement. My DB looks like this: nr | year | month | day here I have data that is simply plain date: 25 | 2009 | 12 | 01 but since there are more then 1 day in a month I have this: 25 | 2009 | 12 | 02 25 | 2009 | 12 | 03 25 | 2009 | 12 | 04 So what I want to do is select the nr 25 and list the dates which have the nr 25 of course. This is very simple with this SQL statement: SELECT * FROM dates WHERE nr = 25 The main thing is, I want to make combo boxes of each collumn in php, so I group it by year, but then I have only 1 result : 25 | 2009 | 12 | 01 And not the others. Anyone knows how to do this? Thanks Link to comment https://forums.phpfreaks.com/topic/186125-group/ Share on other sites More sharing options...
Mchl Posted December 23, 2009 Share Posted December 23, 2009 This query should return all dates with nr = 25. If you only get one, it's quite possible you're doing something wring on PHP side. Link to comment https://forums.phpfreaks.com/topic/186125-group/#findComment-982964 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.