I have a table of Calendar event information (Date, username).
I want to print the following information for each "event" for a selected month in a table, using PHP and MySQL:
SELECT DAYOFWEEK( eventDate ) AS
DAY , YEAR( eventDate ) AS YEAR, `primary` , secondary, weekend
FROM eventcal
WHERE region = 4
AND MONTH( eventDate ) =7
ORDER BY DAYOFWEEK( eventDate )
There can be multiple users associated with a given day. What's the best way to, using MySQL and PHP, build the table so that the usernames sharing a common day are merged together? For example, instead of:
June | 7 | 2009 | doej2
June | 7 | 2009 | smithj2
June | 8 | 2009 | mccoyj2
I want...
June | 7 | 2009 | doej2, smithj2
June | 8 | 2009 | mccoyj2
Any ideas? Thanks!