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
-----------------------------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php