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.

post your table structure and sample data, then let us know which table you want to update from which table, every week.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.