Transactions
Posted: 2016-08-11 10:06
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.
returns the mysqli object.
This means, you can do something like this
And data
You can obtain it with db_link() function.
Code: Select all
$conn = db_link();
var_dump($conn);
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