Dear PHP Developers:
I need assistance with a minor script.
THe script below:
mysql_connect($hostname,$username,$password);
$query = "DELETE FROM Validation WHERE AccumulatedTime >= AllottedTime" or die('Error: Unable to delete expired passwords.');
$query2 = "DELETE FROM Validation WHERE StartDateTime -10 < CURRENT_TIMESTAMP()" or die('Error: Unable to delete old records.');
// Check database and make deletions if necessary
mysql_db_query($dbName, $query);
mysql_db_query($dbName, $query2);
print mysql_error();
mysql_close;
Issue: (Problem with Query 2 erasing the correct records)
The script should delete records that are 10 older than the
Current_TimeStamp. The -10 tends to erase all records that are between 1 and 10 days old. I only want to delete records that are 10 days old. This will be a Cron job.
By the way, the StartDateTime field is a DateTime formatted field.
And, the script runs fine without errors.
VT.
Any suggestions.