Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
MySQL userfriedly Error
Old 03-18-2005, 05:08 AM MySQL userfriedly Error
Experienced Talker

Posts: 34
Trades: 0
Hello. I was wondering how can we add a piece of code to validate the data that is going to be entered within the database and then retrieve a nice error that there is a data duplication, so as to avoid the non-user friendly MySQL error..?

Is it possible for example to retrieve somthing like a pop-up error? Like the windows style error saying for example " There is data duplicatio" or "this record already exists in the database"..

I have set some fields as unique, not null..and when i have test it to add a duplicate record, i receive the following non-friendly mysql error:

"Failed to execute queryDuplicate entry 'piano' for key 1 SQL:SELECT * FROM `instrument_subject` WHERE 0 = 1"
cmakedonas is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-20-2005, 01:22 PM
Experienced Talker

Posts: 34
Trades: 0
Any help on this issue??
cmakedonas is offline
Reply With Quote
View Public Profile
 
Old 03-20-2005, 03:11 PM
Novice Talker

Posts: 6
Trades: 0
mysql_error(); - try that function. It should give you an user friendly error.
Krisx is offline
Reply With Quote
View Public Profile
 
Old 03-23-2005, 09:06 PM
Experienced Talker

Posts: 34
Trades: 0
where can i put this function??
cmakedonas is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to MySQL userfriedly Error
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.05369 seconds with 12 queries