List:General Discussion« Previous MessageNext Message »
From:Jørn Dahl-Stamnes Date:February 25 2007 8:03am
Subject:SQL and PHP: Incorrect errorcode
View as plain text  
Hello folks,

I was playing around with my PHP code that shall report any SQL error. To test 
this code I made an error in a SQL query by changing the table name in the 
field list to a table that did not exist.

This triggered the following error:

	Error message: 'Unknown table 'q' in field list'
        Error code: 1109

The error message is correct, but the problem is that the error code (returned 
by mysql_errno) is not correct.
A 'perror 1109' say "Illegal error code: 1109".

It seems like the error number returned by mysql_errno is not to be trusted, 
or? Any comments?

-- 
Jørn Dahl-Stamnes
homepage: http://www.dahl-stamnes.net/dahls/
Thread
SQL and PHP: Incorrect errorcodeJørn Dahl-Stamnes25 Feb
  • Re: SQL and PHP: Incorrect errorcodeAtle Veka25 Feb