hi,
I'm trying to subtract two dates, and can't seem to get it working at all.
The layout for the date is:
Standard mySQL datetime format.
I want to be able subtract two dates and find how many days appart they are. Simple subtraction won't work, because they're treated as simple strings in PHP.
I did, however, try a bit of SQL to do this.
$result = mysql_query("SELECT to_days(now()) - to_days("2002-06-26 16:08:26")");
$row = mysql_fetch_row($result);
and the result (the days between the two dates) should be in $row.
But I get an error message saying that the '$row = mysql_fetch_row($result);' is "Warning: Supplied argument is not a valid MySQL result resource ".
Any suggestions for date differences??
Thanks in advance.