Signup page problem

siddu

Member
Joined
Dec 5, 2006
Messages
7
Programming Experience
1-3
Hi ..
I am having signup page that contains username,pwd,confpwd,Email,Address and one save button .
when user enter his details and press save button it should save details in database.
i have done upto here.But my problem is:
if Email Entered already Exsists in database then it should display a message that Email already exists in Database.
For this what i have to write Code .Pls send me the Code .
Thank you..
 
There are a few ways to do this:

1. You could do error capturing... and post the message when the insert fails

2. Use SQL to raise a specific error when a duplicate email is found.

3. Check for duplicate email before you save any data. Do a simple select statement with the criteria as the email address.

I would highly recommend that you use the 3rd approach since this is the easiest, and safest way to do it. That way you wouldn't have to worry about transaction or updating data in multiple tables.

Brian
http://Brian-Dao.blogspot.com

PS: sample duplicate email error can be found here (use giadich@hotmail.com) as the address when signing up: http://www.goturls.com
 
Back
Top