pg_execute error
| From: | Yasuo Ohgaki | Date: | Sat, 25 Mar 2006 08:49:18 +0000 |
| Subject: | pg_execute error | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-22575@lists.php.net to get a copy of this message | ||
Hi.
Current pgsql.c supports prepared statement, but pg_execute() will raise
E_WARNING if query plan is not prepared yet. This is annoying when
database connection is persistent under web environment.
I would like to do something like
if (!pg_execute($db, 'myquery', array()) {
pg_prepare($db, 'myquery', 'SQL');
pg_execute($db, 'myquery', array();
}
WITHOUT raising any error, since @ operator does not work well with
error handler. (i.e. need special handling for pg_execute)
There are 4 options:
1) just ignore errors on pg_execute(). errors can be identified by return status anyway.
2) add pg_is_prepared()
3) add bool parameter to pg_execute()
e.g. pg_execute(resource connection, string stmtname, array params, bool ignore_error)
4) ignore pg_execute() error if params is null array.
Any comments?
--
Yasuo Ohgaki