From 144ac6bd899c9b317872ab6023931ced5030ea49 Mon Sep 17 00:00:00 2001 From: Daniel Oaks Date: Thu, 15 Oct 2015 19:31:39 +1000 Subject: [PATCH] Fix the notes extension to work properly on dbs other than MySQL --- ext/notes/main.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ext/notes/main.php b/ext/notes/main.php index 6a66996e..15327cdf 100644 --- a/ext/notes/main.php +++ b/ext/notes/main.php @@ -276,8 +276,7 @@ class Notes extends Extension { (?, ?, ?, ?, now(), ?, ?, ?, ?, ?)", array(1, $imageID, $user_id, $_SERVER['REMOTE_ADDR'], $noteX1, $noteY1, $noteHeight, $noteWidth, $noteText)); - $result = $database->get_row("SELECT LAST_INSERT_ID() AS noteID", array()); - $noteID = $result["noteID"]; + $noteID = $database->get_last_insert_id('notes_id_seq'); log_info("notes", "Note added {$noteID} by {$user->name}"); @@ -304,9 +303,9 @@ class Notes extends Extension { (?, ?, now())", array($image_id, $user_id)); - $result = $database->get_row("SELECT LAST_INSERT_ID() AS requestID", array()); + $resultID = $database->get_last_insert_id('note_request_id_seq'); - log_info("notes", "Note requested {$result["requestID"]} by {$user->name}"); + log_info("notes", "Note requested {$requestID} by {$user->name}"); }