summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-12-01 14:50:10 +0300
committerAndrew Dolgov <[email protected]>2017-12-01 14:50:10 +0300
commitfdda3e4efb49ebd752581f2b3120d8984228a022 (patch)
treefcf2c068223d83be78e93329e0fcf426b684b23d /include
parent4d13514dd4b1ce9fb7e2ce138cbfa50bb6292290 (diff)
pdo pdo pdo
Diffstat (limited to 'include')
-rw-r--r--include/functions.php13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/functions.php b/include/functions.php
index 07f4f0f64..377d49647 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;
}