[ Xelgen ]
Sep 12, 2007, 21:01
I have, a table containing events, and need to show them up in a calendar, for a month.
Here is the table I have.
1.
+------+--------------------+-------------------+------------+
| id | start_date | end_date| text |
+------+--------------------+-------------------+------------+
| 1 | 2007-09-12 00:00:00|2007-09-12 23:59:59| Party |
| 2 | 2007-09-13 00:00:00|2007-09-13 23:59:59| Concert |
| 3 | 2007-09-13 00:00:00|2007-09-17 23:59:59| Festival |
| 4 | 2007-09-15 00:00:00|2007-09-15 23:59:59| Exhibition |
| 5 | 2007-09-16 00:00:00|2007-09-16 23:59:59| Shooting |
+------+--------------------+-------------------+------------+
I'd like to get, smth like.
2
+------+-----------+
| day | Text |
+------+-----------+
| 12| Party |
| 13| Concert |
| 13| Festival |
| 14| Festival |
| 15| Festival |
| 15| Exhibition|
| 16| Festival |
| 16| Shooting |
| 17| Festival |
+------+-----------+
Do you have ideas, how this can be done?
Order, doesn't really matter, currently. So you can ignore, this as well as the time part of DATETIME.
Ideally, I need, to get, smth like :
3
+------+--------------------------+
| day | Text |
+------+--------------------------+
| 12| Party |
| 13| Concert <br> Festival |
| 14| Festival |
| 15| Festival <br> Exhibition |
| 16| Festival <br> Shooting |
| 17| Festival |
+------+--------------------------+
But, I can do this with php, if i'd get the second table.
First table could also be done, through php, but I'd prefer to do it with MySQL, rather then processing "raw data" with PHP.
I'm sure this all can be done though MySQL, but i'm just out of ideas.
Here is the table I have.
1.
+------+--------------------+-------------------+------------+
| id | start_date | end_date| text |
+------+--------------------+-------------------+------------+
| 1 | 2007-09-12 00:00:00|2007-09-12 23:59:59| Party |
| 2 | 2007-09-13 00:00:00|2007-09-13 23:59:59| Concert |
| 3 | 2007-09-13 00:00:00|2007-09-17 23:59:59| Festival |
| 4 | 2007-09-15 00:00:00|2007-09-15 23:59:59| Exhibition |
| 5 | 2007-09-16 00:00:00|2007-09-16 23:59:59| Shooting |
+------+--------------------+-------------------+------------+
I'd like to get, smth like.
2
+------+-----------+
| day | Text |
+------+-----------+
| 12| Party |
| 13| Concert |
| 13| Festival |
| 14| Festival |
| 15| Festival |
| 15| Exhibition|
| 16| Festival |
| 16| Shooting |
| 17| Festival |
+------+-----------+
Do you have ideas, how this can be done?
Order, doesn't really matter, currently. So you can ignore, this as well as the time part of DATETIME.
Ideally, I need, to get, smth like :
3
+------+--------------------------+
| day | Text |
+------+--------------------------+
| 12| Party |
| 13| Concert <br> Festival |
| 14| Festival |
| 15| Festival <br> Exhibition |
| 16| Festival <br> Shooting |
| 17| Festival |
+------+--------------------------+
But, I can do this with php, if i'd get the second table.
First table could also be done, through php, but I'd prefer to do it with MySQL, rather then processing "raw data" with PHP.
I'm sure this all can be done though MySQL, but i'm just out of ideas.