September 4th, 2000, 12:58 AM
Join Date: Jul 2000
Location: Columbus, OH 43212
Time spent in forums: < 1 sec
Reputation Power: 0
I having troubles adding numbers to an existing date that is pulled from a database.
Here's the setup:
A date is stored in the database, (YYYY-MM-DD). The next record must be assigned the next days date, based on whatever the date of the previous record was.
I'm using the following code based on other date adding posts I found here at DevShed:
$sql = "SELECT * FROM Quotes";
$result = mysql_query($sql);
$myrow = mysql_fetch_array($result);
$lastdate = $myrow["QuoteDate"];
$tomorrow = mktime(0,0,0,date("m",$lastdate) ,date("d",$lastdate)+1,date("Y",$lastdate));
$nextday = date("Y-m-d",$tomorrow);
$lastdate is the date of the last record in the DB, and $nextday is supposed to hold $lastdate + 1 - but its failing and giving me the 1970-01-01 issue.
I hope all that read this understand what I'm trying to accomplish - any help is much appreciated. Thanks