From: Andrew Dolgov Date: Fri, 1 Dec 2017 11:50:10 +0000 (+0300) Subject: pdo pdo pdo X-Git-Tag: 17.12~96 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=fdda3e4efb49ebd752581f2b3120d8984228a022;p=tt-rss.git pdo pdo pdo --- 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; }