471,092 Members | 1,539 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

Q: error numbers and mysql versions


Hello

I need to detect duplicate errors when using mysql to insert a row in a
php program. (I assume that the php version should not make a difference,
but I don't know that for sure, which is why I mention php.)

I am using mysql_error() and mysql_errno() - no problem there, but my
question concerns the values they return in different versions of mysql.

With my versions the errno is 1062, and the error string contains the word
"duplicate".

But what will they return if the versions should change?

What is the most reliable way to detect the duplicate error that will
still work if the versions change?

Will the errno remain constant for different versions of mysql?

If not, then what is the best way to handle this, is there a library of
error constants?

Feedback welcome, thanks.

--

This space not for rent.
Jul 23 '05 #1
1 1272
Malcolm Dew-Jones wrote:
Will the errno remain constant for different versions of mysql?
SQLSTATE values are defined by the SQL standard, so perhaps that's most
likely to remain constant. SQLSTATE is supported in MySQL 4.1 and later.
If not, then what is the best way to handle this, is there a library of
error constants?


Does this help?
http://dev.mysql.com/doc/mysql/en/error-handling.html

Regards,
Bill K.
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Wayno | last post: by
4 posts views Thread by gc | last post: by
1 post views Thread by daniel kern | last post: by
6 posts views Thread by Peter Frost | last post: by
12 posts views Thread by ilya_slutsker | last post: by
3 posts views Thread by Greg Noss | last post: by
1 post views Thread by Steve Ametjan | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.