View Single Post
Old 03-23-2009, 02:26 PM   #5 (permalink)
Andrial12
The Wanderer
 
Join Date: Feb 2008
Location: Blackpool, England
Posts: 16
Thanks: 2
Andrial12 is on a distinguished road
Default

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_SUBNOW(), 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
Andrial12 is offline  
Reply With Quote
The Following User Says Thank You to Andrial12 For This Useful Post:
Seraskier (03-23-2009)