in reply to Re: Cycle through primary key with DBI
in thread Cycle through primary key with DBI
I did something quite similar the other day... But instead of using a temporary table, I set up the normal users table with some extra fields:
. Validated
. Validation_Code
+ some others
So, once the user signs up initially, he's sent the Validation_Code, and his entry in that table reads Validated="No".
Once he validates himself (by sending back that validation code), just UPDATE his row to read Validated="Yes".
You can do this using the normal user table, or you can create a secondary table linked to the main one by an ID (since you'll probably want to have a user ID anyway, as the primary key).
As added "niceties", you can have a field showing how many times the user has attempted to send a validation code. I have a limit of 3 attempts, after that, the user is locked out for good.
Also, I have a timestamp. After x number of days/hours/etc, I can scan that table and remove all the entries/users that have signed up, but never properly validated themselves.
Hope this helps...