MySQL - Joining tables question

mr tanooki

Limp Gawd
Joined
Aug 11, 2004
Messages
144
i am not very good at explaining things so i will show you instead

I want to go from a query that returns these two results
Code:
Array ( 
[Program_ID] => 154 
[Schedule_ID] => 2 
[Program_Title] => Program Title
[Program_Description] => Program Description
[Program_Age_Group] => Program Age Group
[B][Event_Date] => 2005-02-01 [/B] 
) 

Array ( 
[Program_ID] => 154 
[Schedule_ID] => 2 
[Program_Title] => Program Title
[Program_Description] => Program Description
[Program_Age_Group] => Program Age Group
[B][Event_Date] => 2005-02-05 [/B] 
)

to a query that returns this one result
Code:
Array ( 
[Program_ID] => 154 
[Schedule_ID] => 2 
[Program_Title] => Program Title
[Program_Description] => Program Description
[Program_Age_Group] => Program Age Group
[B][Event_Date] => Array ( [0] => 2005-02-01 [1] => 2005-02-05 ) [/B] 
)

does anybody know a MySQL function that can let me do this? i have searched online but i have not found anything. thanks in advance for your suggestions
 
first, your bump time seems rather short

anyway, first, what query are you currently using?

i think this is going to require first selecting the unique event without the date and then selecting all the dates that have that event's id

say SELECT <everything you want but the date> FROM table WHERE <unique id>=whatever

and then a second query like SELECT Event_Date FROM table WHERE <unique id>=whatever then loop through the result set and append each date to the above query's result row
 
Back
Top