diff --git a/include/functions.php b/include/functions.php index 07f4f0f6..377d4964 100644 --- a/include/functions.php +++ b/include/functions.php @@ -591,10 +591,10 @@ if (get_schema_version() < 63) $profile_qpart = ""; - ////db_query("BEGIN"); - $pdo = DB::pdo(); + $pdo->beginTransaction(); + $sth = $pdo->query("SELECT pref_name,def_value FROM ttrss_prefs"); $profile = $profile ? $profile : null; @@ -633,7 +633,7 @@ } } - ////db_query("COMMIT"); + $pdo->commit(); } @@ -1952,11 +1952,10 @@ if (!$feed_cat) return false; - ////db_query("BEGIN"); - $feed_cat = mb_substr($feed_cat, 0, 250); $pdo = Db::pdo(); + $pdo->beginTransaction(); $sth = $pdo->prepare("SELECT id FROM ttrss_feed_categories WHERE (:parent IS NULL AND parent_cat IS NULL OR parent_cat = :parent) @@ -1969,11 +1968,13 @@ VALUES (?, ?, ?)"); $sth->execute([$_SESSION['uid'], $feed_cat, $parent_cat_id]); - //db_query("COMMIT"); + $pdo->commit(); return true; } + $pdo->commit(); + return false; }