Error handling
| From: | Guillermo | Date: | Fri, 11 Mar 2005 18:52:45 +0000 |
| Subject: | Error handling | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-38873@lists.php.net to get a copy of this message | ||
Hi,
I'm new to PHP; I installed version 5.0.3 using Apache 2 and Postgres 8 on
Win XP SP2. I have a connection class and one of its methods is:
public function EjecutaSQL($pe_textoSQL = "")
{
return pg_query($this->id, $pe_textoSQL);
}
where $pe_textoSQL contains the SQL sentence. If after executing it there is
a Constraint error sent by the DB for example, or a syntax error in the SQL
statement, no error or warning is displayed in the browser, unless I use
"pg_last_error()" and handle the error myself.
I checked the PHP.ini and I have the parameter "error_reporting = E_ALL"
Testing these examples on PHP 4, adjusting all the necesary code to run from
5 to 4, all warnings and errors are displayed as sent by PostgreSQL.
Any help will be appreciated,
Thanx
Guillermo N