Skip to content
Snippets Groups Projects
Commit b5c13f1c authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #2682 fix PDO

parent e8df116e
No related branches found
No related tags found
No related merge requests found
...@@ -198,9 +198,9 @@ class notes ...@@ -198,9 +198,9 @@ class notes
{ {
$query = "SELECT id FROM ".NOTE_ENTITIES_TABLE." WHERE note_id = ?"; $query = "SELECT id FROM ".NOTE_ENTITIES_TABLE." WHERE note_id = ?";
$stmt = $db->query($query, array($res->id)); $stmt2 = $db->query($query, array($res->id));
if($stmt->rowCount()==0) { if($stmt2->rowCount()==0) {
array_push($userNotes, array_push($userNotes,
array('id' => $res->id, //ID array('id' => $res->id, //ID
'label' => functions::show_string($res->note_text), //Label 'label' => functions::show_string($res->note_text), //Label
...@@ -209,13 +209,13 @@ class notes ...@@ -209,13 +209,13 @@ class notes
) )
); );
} else { } else {
$stmt = $db->query( "SELECT id FROM notes WHERE id in (" $stmt2 = $db->query( "SELECT id FROM notes WHERE id in ("
. "select note_id from ". NOTE_ENTITIES_TABLE. " where (item_id in (" . "select note_id from ". NOTE_ENTITIES_TABLE. " where (item_id in ("
."SELECT entity_id FROM users_entities WHERE user_id = ?) and note_id = ?))" ."SELECT entity_id FROM users_entities WHERE user_id = ?) and note_id = ?))"
. "or (id = ? and user_id = ?)", . "or (id = ? and user_id = ?)",
array($_SESSION['user']['UserId'], $res->id, $res->id, $_SESSION['user']['UserId'])); array($_SESSION['user']['UserId'], $res->id, $res->id, $_SESSION['user']['UserId']));
if($stmt->rowCount()<>0) { if($stmt2->rowCount()<>0) {
array_push($userNotes, array_push($userNotes,
array('id' => $res->id, //ID array('id' => $res->id, //ID
'label' => functions::show_string($res->note_text), //Label 'label' => functions::show_string($res->note_text), //Label
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment