Hide duplicate entry error?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
SmokyBarnable
Forum Contributor
Posts: 105
Joined: Wed Nov 01, 2006 5:44 pm

Hide duplicate entry error?

Post by SmokyBarnable »

I made a field unique to prevent duplicate rows when inserting. This works fine the only problem is it outputs an error on the web page for everyone to see. Is there a way to supress this error?

1062 - Duplicate entry '34025334007' for key 2
(here is shows the insert into query)
[TEP STOP]
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Post by kaszu »

I think you can prevent outputting by using @mysql_query
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

The error message is only shown, when your code says it should show the error... So, show us your code ;)

(Probably a die(mysql_error()) or something alike)
Post Reply