commit and rollback
am 10.09.2005 09:48:38 von ThanksHi,
I have a problem about commit and rollback using php. For the script below,
if "foo" is called and commit and if rollback statment also run. Will the
update statement under foo also rollback? or commit?
Thanks in advance!
------------------------------------------------------------ ----------------
-----------Script starts
function foo(var1,var2)
{
pg_query($db,"begin");
pg_query($db,"
pg_query($db,"commit");
}
pg_query($db,"begin");
......
foo(v1,v2);
$result1=pg_query($db,"
if (pg_affected_rows($result)==0)
pg_query($db,"rollback");
else
pg_query($db,"commit");
------------------------------------------------------------ ----------------
-----------Script end
--
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faq