I have 1 table (meetings) containing some occursion unix timestamps (dates), mostly upcoming meetings in future.
For example:
id.1 30-3-2011 (Wednesday) – future
id.2 31-3-2011 (Thursday). – future
On the other hand, there is 1 more table (schedule), containing unix timestamps also in column(dates) but – in past. In a difference to example above, these are sessions going on every Wednesday, or Tuesday, every week. Although dates are written in past, by using date_format (w), PHP collects them out by function date(“w”), as “for today” whats not a problem.
ie.
id.44 15-3-2011 (Tuesday) – past (3 weeks ago!)
id.45 25-3-2011 (Friday) – past
Now, problem occurs to show them all joined as in future as “upcomings” by – distinct dates and days!
Today is Monday 28/3/2011 and output should look like this.
++Tuesday (29.3)
id.44
++ Wednesday (30.3)
id.1
++ Thursday (31.3.)
id.2
++ Friday (1.4.)
id.45.
Really, any ideas? 🙂
Separated queries per distinct dates are also welcome. Thanks!
Marc, Skrol29, everyone thanx for effort. Unfortunately, those “past” meetings may contain dates way beyond in past (over 2 years sometimes) so hard coding will not do the job.
It seems this table requires special 24/7/30 algorithm/calendar, sort of converter before main query itself but its something I can do myself.
I just had a thought theres easier or practical solution, but seems not.