03-23-2009, 02:26 PM
|
#5 (permalink)
|
|
The Wanderer
Join Date: Feb 2008
Location: Blackpool, England
Posts: 16
Thanks: 2
|
You could also solve this problem in in your database. I've always thought working with dates in MySQL is far easier that in PHP.
For example.
PHP Code:
DELETE FROM `users`
WHERE
`signupdate` < DATE_SUB( NOW(), INTERVAL 24 HOUR )
AND `lastlogin` = `signupdate`
With this method you use datetime as a field rather than varchar. Also you would set the `lastlogin` field to the same as the signup time, that way if they're the same after 24 hours mysql will delete them.
For for information on INTERVAL:
http://dev.mysql.com/doc/refman/5.1/...ction_date-add
Hope that helps.
NB: I've not tested this so try it on test data so you don't empty your entire database :D
|
|
|
|