]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
some more pdo stuff
[tt-rss.git] / include / functions.php
index 1f9c80a028b6f27748ef0d5e6290ac87385733dd..58f4ba31cdc172bfc8412cc61d79a00a8dc4f7ed 100644 (file)
         $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();
 
                $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) {