For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > February 2005 > Error catching









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Error catching
Birdy

2005-02-28, 8:55 am

I want a php script to report the error.

the error is generetad by mysql when inserting a duplicate entry.
Now the scripts ends and does nothing elde.
The user who wants to insert a record in database must be notified of the
excisting problem.

i want to use this on an webpage






Sebestyén Dénes

2005-02-28, 8:55 am

Birdy írta:
> I want a php script to report the error.
>
> the error is generetad by mysql when inserting a duplicate entry.
> Now the scripts ends and does nothing elde.
> The user who wants to insert a record in database must be notified of the
> excisting problem.
>
> i want to use this on an webpage


Well, the mysql_query() function gives back a FALSE if the mysql server
reports error when inserting into the table. If you want to do actions
on specific messages, you should use the mysql_errno() and mysql_error()
functions.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com