possible bug in DB/pgsql.php
| From: | Burak DAYIOGLU | Date: | Mon, 12 Feb 2001 16:43:51 +0000 |
| Subject: | possible bug in DB/pgsql.php | ||
| Groups: | php.pear | ||
| Request: | Send a blank email to php-pear+get-1326@lists.php.net to get a copy of this message | ||
Hello,
I have asked Mr. Bakken about transaction management in DB/pgsql.php
before via a private msg. I have had written a quick hack to check out
how it works...
The below code is assumed to make two inserts and rollback afterwards.
I was expecting to see no records inserted however both inserts ended
with success.
Any ideas on how to implement transactions with postgresql? Am I doing
anything wrong? (BTW, running on RH6.2 Linux w/ Php4.0.4pl1, cvs
synched fresh PEAR and pgsql 7.0.3...)
with regards,
-bd
<?php
require_once("/usr/local/lib/php/DB.php");
$database=DB::factory("pgsql");
$dsn=array(phptype=>"pgsql",hostspec=>"localhost",database=>"kek");
$database->connect($dsn);
$database->autocommit(FALSE);
$handle=$database->query("insert into names values
(1,'burak')");
$handle=$database->query("insert into cities values
(2,'ankara')");
$database->rollback();
?>