diff options
author | Alex Auvolat <alex@adnab.me> | 2017-01-18 19:12:01 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2017-01-18 19:12:01 +0100 |
commit | cb727d392892ba2b6199a918f320dc6423d74d4c (patch) | |
tree | 8f451bfa89c1d85c404e2f16be37705c89eb2fb6 /tpl/notes/inc_relativestree.php | |
parent | 77048675abf5fad43e8b5371c35e1c86b3be59c2 (diff) | |
download | Bits-cb727d392892ba2b6199a918f320dc6423d74d4c.tar.gz Bits-cb727d392892ba2b6199a918f320dc6423d74d4c.zip |
Start update to PDO instead of old mysql_ functions
Diffstat (limited to 'tpl/notes/inc_relativestree.php')
-rw-r--r-- | tpl/notes/inc_relativestree.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tpl/notes/inc_relativestree.php b/tpl/notes/inc_relativestree.php index fd47ab4..295e552 100644 --- a/tpl/notes/inc_relativestree.php +++ b/tpl/notes/inc_relativestree.php @@ -4,10 +4,10 @@ $notes_tree = array(); $notes_parents = array(); $n = sql("SELECT id, parent, title FROM notes ". - "WHERE owner = " . $note['owner'] . + "WHERE owner = ?" . ($note['owner'] == $user['id'] ? " " : " AND public != 0 ") . - "ORDER BY title ASC"); -while ($nn = mysql_fetch_assoc($n)) { + "ORDER BY title ASC", $note['owner']); +while ($nn = $n->fetch()) { $notes_parents[$nn['id']] = $nn['parent']; if (isset($notes_tree[$nn['parent']])) { $notes_tree[$nn['parent']][] = $nn; |