nieuws/replies: insert method to add database rows
[minimedit.git] / widget / nieuws / replies.php
index 13533c99fe09a35049f23d918ced22ecd5e591cb..cfa948715367086f7fd0ce663b7083cf416a75c8 100644 (file)
@@ -8,8 +8,10 @@ if ($_POST) {
        try {
                $html = nl2br(htmlspecialchars($_POST['reply']));
                $html = "<p>$html</p>";
-               $query = $Db->query('INSERT INTO comments (page, message, author) VALUES (?, ?, ?)', [
-                       $Page, $html, $User->login
+               $query = $Db->insert('comments', [
+                       'page'    => $Page,
+                       'message' => $html,
+                       'author'  => $User->login,
                ]);
                if (!$query->rowCount()) {
                        throw new Exception('Fout bij opslaan');