I am pretty new to php, and trying to work with dates right now from a mysql table, the idea is that I want a table to update every week to show what is happening this week. The dates are stored in the mysql table in $table labled as date and in the normal mysql date format. I know how to get todays date but completely confused on how to compare it with the dates from the database to tell if it falls within that week. The best that I can tell the pseudo-code should go something like this:
get today's date and set to X: todays_date(Date("Y-m-d"))
set X to Y in a 1 time event: unknown
set query in a 1 time event to this weeks happenings: unknown
manually set counter for 1 time event: unknown
if X not the same as Y add 1 to the counter: if ($currentdate != $yesterdaysdate) { $count++; }
when counter > 7 reset and update query: unknown
query database to find out what happens this week: unknown
Display stuff happening this week: unknown
I started trying to code this and it's way over my head, so wondering if someone could give me a hand. Feel free to give help on the pseudo-code problems or any of the unknown stuff.