X-Git-Url: http://git.shiar.net/minimedit.git/blobdiff_plain/8f05d49e133e9ca27d20bfc3835fc08812a683cb..23d1415e31c8cb5db2756959e8951ca5f28c476d:/issue/index.php 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 '