Re: Problem with DB::isError
| From: | Martin Marques | Date: | Wed, 04 Feb 2004 22:37:56 +0000 |
| Subject: | Re: Problem with DB::isError | ||
| References: | 1 | Groups: | php.general php.pear.general |
| Request: | Send a blank email to php-general+get-176849@lists.php.net to get a copy of this message | ||
El Mié 04 Feb 2004 16:45, David Clymer escribió:
> I'm having some problems with the DB::isError function identifying a
> non-object as an error object (or so it seems). I'm using postgreSQL
> 7.3.x. The relevant code is below:
>
> /*******************[ my code start ]***********************/
>
> $sql_queries = array();
>
> $sql_queries[0] = 'BEGIN';
> $sql_queries[1] = "INSERT INTO domain (name,table_name)
> VALUES('$domainname','$tablename')";
> $sql_queries[2] = 'CREATE TABLE ' . $tablename . '_account ()
> INHERITS (domain_account_template)';
> $sql_queries[3] = 'CREATE TABLE ' . $tablename . '_alias () INHERITS
> (domain_alias_template)';
> $sql_queries[4] = 'CREATE TABLE ' . $tablename . '_option ()
> INHERITS (domain_account_template)';
> $sql_queries[5] = 'END';
Please, remove the 'BEGIN' and hte 'END' queries and set autocommit to false:
$db->autoCommit(false);
When you finish with the real queries you do one of these:
$db->commit();
or
$db->rollback();
If you keep on having problems, then send us another mail, but use the commit
and rollback functions in PEAR::DB
--
19:33:01 up 71 days, 1:49, 2 users, load average: 1.17, 0.82, 0.57
-----------------------------------------------------------------
Martín Marqués | select 'mmarques' || '@' || 'unl.edu.ar'
Centro de Telematica | DBA, Programador, Administrador
Universidad Nacional
del Litoral
-----------------------------------------------------------------