[prev in list] [next in list] [prev in thread] [next in thread]
List: pear-general
Subject: [PEAR] AutoExecute & postgresql / Error ignored
From: "Nelson E. Castillo" <nelson () politecnica ! edu ! co>
Date: 2004-03-29 1:06:42
Message-ID: 20040329010642.GC3897 () mail ! politecnica ! edu ! co
[Download RAW message or body]
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.
[Attachment #3 (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic