From fdda3e4efb49ebd752581f2b3120d8984228a022 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 1 Dec 2017 14:50:10 +0300 Subject: [PATCH] pdo pdo pdo --- include/functions.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) 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; } -- 2.39.5