From: Mischa POSLAWSKY Date: Thu, 7 Nov 2019 04:56:00 +0000 (+0100) Subject: issue: select restricted by current page X-Git-Tag: v4.2~23 X-Git-Url: http://git.shiar.net/minimedit.git/commitdiff_plain/23d1415e31c8cb5db2756959e8951ca5f28c476d issue: select restricted by current page Allow setup of multiple distinct categories. --- diff --git a/issue/index.php b/issue/index.php index ff99064..d07a786 100644 --- a/issue/index.php +++ b/issue/index.php @@ -7,7 +7,7 @@ if ($id) { $Article->title = "Issue #$id"; $Issue = $Db->query( - 'SELECT * FROM issues WHERE id = ?', [$id] + 'SELECT * FROM issues WHERE page = ? AND id = ?', [$Page, $id] )->fetch(); if (!$Issue) throw new Exception('Issuenummer niet gevonden'); @@ -50,12 +50,12 @@ if ($_POST) { $_POST = []; } -$sql = 'SELECT * FROM issues'; +$sql = 'SELECT * FROM issues WHERE page = ?'; if (isset($_GET['open'])) { - $sql .= ' WHERE closed IS NULL'; + $sql .= ' AND closed IS NULL'; } $sql .= ' ORDER BY closed IS NOT NULL, updated DESC'; -$query = $Db->query($sql); +$query = $Db->query($sql, [$Page]); ob_start(); print '