adding a week to a mysql retrieved date
Posted: Wed Sep 20, 2006 6:49 am
Got a database that handles a weekly rota, so each row contains a date in the form yyyy-mm-dd.
I want to add another years worth of dates automatically.
I can grab the last date in the the table
So $lastdate[date] contains 2006-12-31
What do I do to make it in a form that I can iterate adding 7 days to it 52 times and inserting it back in!
Can you help please
I want to add another years worth of dates automatically.
I can grab the last date in the the table
Code: Select all
$query="SELECT date from sundayrota order by date desc";
$result=mysql_query($query);
$lastdate=mysql_fetch_assoc($result);What do I do to make it in a form that I can iterate adding 7 days to it 52 times and inserting it back in!
Can you help please