Re: [PHP-DB] Catch Errors

2003-03-30 Thread Leif K-Brooks
www.php.net/mysql-error

shaun wrote:

Hi,

Is it possible to catch the type of error message returned form a
mysql_query(); funtion
for example

if ($error == //duplicate row for table)
{
   echo "This row already exists in the table";
}


 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP-DB] Catch Errors

2003-03-30 Thread John W. Holmes
> Is it possible to catch the type of error message returned form a
> mysql_query(); funtion
> 
> for example
> 
> if ($error == //duplicate row for table)
> {
> echo "This row already exists in the table";
> }

Use mysql_error() and mysql_errno().

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Catch Errors

2003-03-30 Thread shaun
Hi,

Is it possible to catch the type of error message returned form a
mysql_query(); funtion

for example

if ($error == //duplicate row for table)
{
echo "This row already exists in the table";
}



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php