X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=include%2Fdba.php;h=3af8522516c64ca9f4306cdff9b836f02302bfac;hb=d7b420a44e9e196a51b78b60bc78a491757cf299;hp=b9d7f71e53dbe32e6181b7d06a1a4e3c99d37e51;hpb=2bbcbdc7041843bf1e0f116b0d59b371e670daf9;p=friendica.git diff --git a/include/dba.php b/include/dba.php index b9d7f71e53..3af8522516 100644 --- a/include/dba.php +++ b/include/dba.php @@ -845,7 +845,7 @@ class dba { } /** - * @brief Insert a row into a table + * @brief Delete a row from a table * * @param string $table Table name * @param array $param parameter array @@ -918,7 +918,9 @@ class dba { if (!$in_process) { // Now we finalize the process - if (!self::$in_transaction) { + $do_transaction = !self::$in_transaction; + + if ($do_transaction) { self::transaction(); } @@ -932,7 +934,7 @@ class dba { logger(dba::replace_parameters($sql, $command['param']), LOGGER_DATA); if (!self::e($sql, $command['param'])) { - if (!self::$in_transaction) { + if ($do_transaction) { self::rollback(); } return false; @@ -962,7 +964,7 @@ class dba { logger(dba::replace_parameters($sql, $field_values), LOGGER_DATA); if (!self::e($sql, $field_values)) { - if (!self::$in_transaction) { + if ($do_transaction) { self::rollback(); } return false; @@ -970,7 +972,7 @@ class dba { } } } - if (!self::$in_transaction) { + if ($do_transaction) { self::commit(); } return true;