From cc9450c309dbeedadaf23a8140520ab3726e3206 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 1 Dec 2017 19:42:02 +0300 Subject: ccache, misc: fixes feeds: start PDO transition --- include/controls.php | 7 +++---- include/functions.php | 4 ++-- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/controls.php b/include/controls.php index 278725463..931ccdd52 100644 --- a/include/controls.php +++ b/include/controls.php @@ -95,7 +95,7 @@ function print_feed_multi_select($id, $default_ids = [], c2.parent_cat = ttrss_feed_categories.id) AS num_children FROM ttrss_feed_categories WHERE owner_uid = :uid AND - (parent_cat = :root_id OR :root_id IS NULL AND parent_cat IS NULL) ORDER BY title"); + (parent_cat = :root_id OR (:root_id IS NULL AND parent_cat IS NULL)) ORDER BY title"); $sth->execute([":uid" => $_SESSION['uid'], ":root_id" => $root_id]); @@ -189,7 +189,7 @@ function print_feed_cat_select($id, $default_id, c2.parent_cat = ttrss_feed_categories.id) AS num_children FROM ttrss_feed_categories WHERE owner_uid = :uid AND - (parent_cat = :root_id OR :root_id IS NULL AND parent_cat IS NULL) ORDER BY title"); + (parent_cat = :root_id OR (:root_id IS NULL AND parent_cat IS NULL)) ORDER BY title"); $sth->execute([":uid" => $_SESSION['uid'], ":root_id" => $root_id]); $found = 0; @@ -338,5 +338,4 @@ function print_label_select($name, $value, $attributes = "") { print ""; -} - +} \ No newline at end of file diff --git a/include/functions.php b/include/functions.php index 8d25457c9..c28460dff 100644 --- a/include/functions.php +++ b/include/functions.php @@ -601,7 +601,7 @@ $u_sth = $pdo->prepare("SELECT pref_name FROM ttrss_user_prefs WHERE owner_uid = :uid AND - profile = :profile OR (:profile IS NULL AND profile IS NULL)"); + (profile = :profile OR (:profile IS NULL AND profile IS NULL))"); $u_sth->execute([':uid' => $uid, ':profile' => $profile]); $active_prefs = array(); @@ -1957,7 +1957,7 @@ $pdo->beginTransaction(); $sth = $pdo->prepare("SELECT id FROM ttrss_feed_categories - WHERE (:parent IS NULL AND parent_cat IS NULL OR parent_cat = :parent) + WHERE (parent_cat = :parent OR (:parent IS NULL AND parent_cat IS NULL)) AND title = :cat AND owner_uid = :uid"); $sth->execute([':parent' => $parent_cat_id, ':title' => $feed_cat, ':uid' => $_SESSION['uid']]); -- cgit v1.2.3