>  I have a problem here again regarding the date comparison. I need to
> check the most recent date that was entered in mysql database in date
> format ("Y-m-d"), if the datetoday is a day or two days in advanced
> compared to the queried date.
> I need to make sure that the  next inserted date in the mysql database
> whould be the next day of  the last inserted date.

Wow...that's confusing. :)

You will probably want to look at the DATE_SUB and DATE_ADD functions in
MySQL. They are in the Date and Time section of Chapter 6 in the manual.

Something like this would insert the "date" and the day after it into
two columns in the database.

$date = '2002-10-31';

$r = mysql_query("INSERT INTO your_table (todaydate, tomorrowdate)
VALUES ('$date','$date' + INTERVAL 1 DAY)");

INTERVAL is a shortcut to the DATE_SUB and DATE_ADD functions.

---John Holmes...

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to