[PHP-DB] RE: mysql_errno() list?

2003-01-12 Thread James Booker
Thanks for replying Adam,

I know how to trap an error and how to show errors in the document, what i
was aiming for is to build my own system of user-friendly errors into my
database layer of my server application to make the errors nicer, and wanted
to write myself an include file with nicer versions of all the errors in.

It turnsa out the text file I talked about in my original poost actually has
what I need, but thanks anyway

Kind regards
James

-Original Message-
From: Adam Royle
To: James Booker; [EMAIL PROTECTED]
Sent: 10/01/03 22:30
Subject: Re: mysql_errno() list?

Just use a combination of mysql_errno() and mysql_error(): 

 echo mysql_errno() . ": " . mysql_error(). "\n"; 

Adam 

PS. Documentation always rocks! 


>Hi guys, 
>I've been playing with PHP for a while now, and love the mysql
>functions, 
>but there's one thing I'd like to know... 
>
>I want to check if a mysql error is a certain number, and thats all
>fair 
>enough because every time i encounter an error I can write down what
>that 
>error was. However, it would be handy if I could have my own define
>file 
>with all the errors in. Can I ask if anyone has a list of errors and
>their 
>numbers for mysql_errno? I've looked on the web and found a load of
>errors 
>for the mysql daemon (the page told me to look in 
>/usr/share/mysql/mysql_errors.txt) but this isnt the file I want as the
>
>errors there relate to the server and not errors with a query I'm
>running 
>
>Thanks in advance for any help 
>
>James Booker 
>EMPICS Sports Photo Agency 
>http://www.empics.com 
>



[PHP-DB] Re: mysql_errno() list?

2003-01-10 Thread Adam Royle
Just use a combination of mysql_errno() and mysql_error():

 echo mysql_errno() . ": " . mysql_error(). "\n";

Adam

PS. Documentation always rocks!


Hi guys,
I've been playing with PHP for a while now, and love the mysql 
functions,
but there's one thing I'd like to know...

I want to check if a mysql error is a certain number, and thats all 
fair
enough because every time i encounter an error I can write down what 
that
error was. However, it would be handy if I could have my own define 
file
with all the errors in. Can I ask if anyone has a list of errors and 
their
numbers for mysql_errno? I've looked on the web and found a load of 
errors
for the mysql daemon (the page told me to look in
/usr/share/mysql/mysql_errors.txt) but this isnt the file I want as the
errors there relate to the server and not errors with a query I'm 
running

Thanks in advance for any help

James Booker
EMPICS Sports Photo Agency
http://www.empics.com