As far as I can see, temp
is useless. It means the same thing as unverified.
This SQL is broken:
DELETE from members WHERE verified == 0 & time + 1 > NOW();
&
is a bitwise operator. You wantAND
- SQL use a single
=
not==
- You will delete accounts less than an hour old, not more than an hour old
Try:
DELETE FROM members WHERE verified = 0 AND time + 1 < NOW();
Datetime is the correct field type for time, but I'd name the field creation_time
or something so you have a clue what it means. You can set it's value by passing NOW()
to SQL, e.g. INSERT INTO members SET time=NOW(), ...
.