View Single Post
Old 07-22-2013, 04:07 AM   #7
jmichae3
 
Join Date: Dec 2010
Posts: 366
Default

also, I was just thinking, unless someone is actively maintaining the database to crop off old stuff, you may want to put a limit on the events. if they are all future events, you can cut off all old events using this SQL:

it's easy enough to use explode() to convert a date and time into mysql format and back. only thing to take into account is 12-hour crossings. results in about 50-100 lines of code.

I would not use unix timestamps personally, I just use the standard SQL DATE or DATETIME datatype which is based on YYYY-MM-DD HH:MM:SS

Code:
DELETE FROM abc_events WHERE somedtcolumn < CURDATE()
at the top of your page to eliminate old events (eliminates chron jobs), and then it's as simple as

Code:
SELECT *,MONTH(somedtcolumn) FROM abc_events ORDER BY somedtcolumn,id
__________________
------------
Jim Michaels
HTML Code:
improperly<strong>nested<em>elements</strong>cause</em>
browser confusion (I believe the term is 'tag soup')!
jmichae3 is offline   Reply With Quote