Forum Moderators: coopster

Message Too Old, No Replies

Custom Error for MySQL?

         

McBlack

9:41 pm on Feb 9, 2008 (gmt 0)

10+ Year Member



I made a table in my database unique, and I'm trying to write something with a member database.

You're only supposed to be able to submit a certain form once, but it says "Error: Duplicate entry 'Example' for key 1" I want it to say "Sorry, you're only allowed to do that once."

How could I do that?

Gian04

4:04 am on Feb 10, 2008 (gmt 0)

10+ Year Member



1st check for the key if it is already on the table
2nd if FOUND echo "Sorry, you're only allowed to do that once."
3rd if NOT FOUND proceed with saving.