summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2017-12-01 10:35:22 +0300
committerAndrew Dolgov <[email protected]>2017-12-01 10:35:22 +0300
commit8aa568b3a22ca613eee488843f415080554c1ecd (patch)
tree7b057ca6480b10d232230d0af4b7a0549aa07614 /include
parentbfc54b036901f3312d622cfdc40833deac6069fb (diff)
some more pdo stuff
Diffstat (limited to 'include')
-rw-r--r--include/functions.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/functions.php b/include/functions.php
index 1f9c80a02..58f4ba31c 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -600,8 +600,9 @@
$profile = $profile ? $profile : null;
$u_sth = $pdo->prepare("SELECT pref_name
- FROM ttrss_user_prefs WHERE owner_uid = ? AND profile = ?");
- $u_sth->execute([$uid, $profile]);
+ FROM ttrss_user_prefs WHERE owner_uid = :uid AND
+ (:profile IS NULL AND profile is NULL OR profile = :profile)");
+ $u_sth->execute(['uid' => $uid, 'profile' => $profile]);
$active_prefs = array();
@@ -1966,7 +1967,7 @@
$pdo = Db::pdo();
$sth = $pdo->prepare("SELECT id FROM ttrss_feed_categories
- WHERE $parent_qpart AND title = '$feed_cat' AND owner_uid = ?");
+ WHERE parent_cat = ? AND title = '$feed_cat' AND owner_uid = ?");
if (db_num_rows($result) == 0) {