AutoExecute & postgresql / Error ignored
| From: | Nelson E. Castillo | Date: | Mon, 29 Mar 2004 01:06:42 +0000 |
| Subject: | AutoExecute & postgresql / Error ignored | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-11518@lists.php.net to get a copy of this message | ||
Hi.
Q: How do I catch this postgresql error from PHP
using Pear?
I run into a situation where an error message
should be returned and it's not. Is there a
workaraund? Maybe I'm doing something wrong.
The user who performed the query doesn't have
permission to insert records and postgresql
complains about it. The point is that autoExecute
doesn't report any error.
I know I need to give the rights to the user... I
am actually concerned about the error message
being lost. I also tried using Execute with the
same result.
In syslog I get:
[1] LOG: connection received:host=127.0.0.1 port=33842
[2] LOG: connection authorized:user=kumaralogin database=login
[3] ERROR: usuarios: permission denied
Here's the code:
$db =& DB::connect( ...);
if (DB::isError($db))...
$db->autoExecute('usuarios',
array ('usuarios_login' => 'joe'),
DB_AUTOQUERY_INSERT);
if (DB::isError($db))
{
// Code not reached... It seems Pear doesn't get it... :(
}
$db->disconnect();
?>
Thanks,
Nelson.-
--
http://geocities.com/arhuaco
The first principle is that you must not fool yourself
and you are the easiest person to fool.
-- Richard Feynman.