NYCPHP Meetup

NYPHP.org

[nycphp-talk] design question: user self-registration

David Krings ramons at gmx.net
Tue Aug 31 15:05:15 EDT 2010


On 8/31/2010 12:43, David Mintz wrote:
> In some cases, though, there may already be a row in people corresponding to
> the new user. If I attempt the insert and the email already exists I will get
> a duplicate email error. But if I instead run an update on the
> already-existing row, I will have done the update without first verifying the
> email. I am therefore thinking that the pending person/user rows maybe ought
> to be stored somewhere else temporarily. I am even thinking, maybe serialize
> much of the person and user details, perhaps as JSON, since it's just being
> crammed away temporarily pending verification.
>
> What would you do?
>

Hi!

I would tell them that they are already registered with that email and offer 
them to send them a temporary password to said email address in case they 
forgot the one they chose before. The Insert to fail is exactly what you want, 
saves one query compared to first checking and if not in the table inserting.

David



More information about the talk mailing list