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.

8 Years
Discussion Span
Last Post by urtrivedi

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

Edited by urtrivedi: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.