On Wednesday 12 March 2008 4:47:33 am A B wrote:
> I think I need some help on making it clear on how to use transactions
> in php in a "correct" way.
> Lets consider this code/pseudocode
> So the question is: how do I write the pseudocode parts in php?
> Any other general suggestions on how to make the function more "fool
> proof" is appreciated. :-)
I recommend use of PEAR::MDB2 or "PDO".. typically what I do is run
the query, rollback if error, continue if not. if you want to be extra
thorough using MDB2, you can check to make sure the database supports
transactions, and after a "begin" you can make sure that the transaction has
been started. my understanding is that PDO has a *very* similar interface to
MDB2, except that PDO is written in C.
hope that helps some.. if you have more questions post again or email me
"websites that suck less"
In response to
pgsql-php by date
|Next:||From: William Temperley||Date: 2008-03-13 23:21:33|
|Subject: Is pgsql threadsafe?|
|Previous:||From: A B||Date: 2008-03-12 08:47:33|
|Subject: first transactions|