From cb727d392892ba2b6199a918f320dc6423d74d4c Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Wed, 18 Jan 2017 19:12:01 +0100 Subject: Start update to PDO instead of old mysql_ functions --- tpl/notes/inc_relativestree.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'tpl/notes/inc_relativestree.php') 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; -- cgit v1.2.3