Jump to content

GROUP


Miko

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.