Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.