Page 1 of 1

Transactions

Posted: 2016-08-11 10:06
by DevGiu
If you need to do some process and want to use transaction, you need the connection object to do this.
You can obtain it with db_link() function.

Code: Select all

$conn = db_link();
var_dump($conn);
returns the mysqli object.
This means, you can do something like this

Code: Select all

$conn = db_link();
$conn->autocommit(false);
sql("UPDATE mytable set myfield = '12345'", $eo);
if (itsallok){
   $conn->commit();
}else if (OMG_forgot_where_clause){
   $conn->rollback();
}

And data

Re: Transactions

Posted: 2016-08-30 09:49
by grimblefritz
This would be a nice option in the designer - use transactions y/n - either globally or by table.