473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1362
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
4
by: gc | last post by:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and...
5
by: Martin | last post by:
I don't know if this is a PHP problem or a MySQL problem - hopefully, someone here can give me a clue. I am getting the subject error when I try to connect to MySQL from a PHP page. $conn =...
1
by: daniel kern | last post by:
Please help with the following issue. I am trying to dump a table. My mysqldump command is: mysqldump.exe -u xx -P xx --add-drop-table --quick --extended-insert --result-file=xx "--where=cdrdate...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
12
by: ilya_slutsker | last post by:
I am having error trying to run some mysql script (back from 2001). It gives me the error like : ERROR 1067 (42000) at line 48: Invalid default value for 'log_id' in the statement : CREATE...
3
by: Greg Noss | last post by:
I'm trying to install MySQL. During the security settings portion fo the setup. I keep getting a Connection Error. Error Nr. 1045 Access denied for user'root'@'localhost'(using password:YES) ...
1
by: Steve Ametjan | last post by:
I've been trying to get MySQL-python to install on Leopard for the past couple of days, and I keep running into relatively the same error. I'm hoping that someone on this list will be able to...
49
by: Julian Bowler | last post by:
Please can some one help with my problem; I am running Apache web server on my lap top, plus a mysql server and php. The version of php currently installed is 5.2.5. when i write some php to connect...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.