Hi guys,
I was hoping for some help if possible?
I need to find a way to mark entries in the MYSQL DB as expired once the expired date has passed.
I plan on putting some code on the top of my front page so it can make this check whenever my site is loaded.
example of data in expiry_date column
2006-09-20 13:28:10
I am using a function to get the current date (it is stored in $currentdatetime variable), it is oputputting the date as:
2006-09-27 14:29:08
Would I use '<' Less than ??
I was hoping for some help if possible?
I need to find a way to mark entries in the MYSQL DB as expired once the expired date has passed.
I plan on putting some code on the top of my front page so it can make this check whenever my site is loaded.
example of data in expiry_date column
2006-09-20 13:28:10
I am using a function to get the current date (it is stored in $currentdatetime variable), it is oputputting the date as:
2006-09-27 14:29:08
Would I use '<' Less than ??
PHP Code:
// run the query
$SQL = " UPDATE postings SET status = 'expired' WHERE expiry_date < LESS THAN ?? $currentdatetime";
Comment