Forums

This topic is locked

duplicate record error

Posted 19 Dec 2001 19:06:21
1
has voted
19 Dec 2001 19:06:21 andy budd posted:
Hi there,

I have just set up an asp (javascript) page in UD that allows a person to sign up to a newsletter. it very simply add's the persons email address to a mySQL DB.

If you try and add the same email address again, because the email recore is set to be unique, you get an error message returned saying that the record already exists. How can I get UD to produce a custom page if a record already exists, saying somthing like "that email address is already subscribed to our newsletter"?



Replies

Replied 25 Dec 2001 20:45:52
25 Dec 2001 20:45:52 Michael Moore replied:
Hi, you have to check the database after the submit button but before the insertion. You check to see if it exists, if so, redirect to error or dialog page. If not, let em proceed. thanks, Mike

Replied 15 Feb 2003 17:08:32
15 Feb 2003 17:08:32 Mark Taylor replied:
I just solved this problem by using the Server Behaviours > User Authentication > Check New User Name
server behaviour. Select the text field used to submit the email address and select the redirect page (the one saying "sorry that email address already in the database". I'm using MS Access for this project. Hope it works with your mySQL

Reply to this topic