From d4a657334d4100c29a700d21e05b5e7fef8fce64 Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Thu, 25 Mar 2021 19:57:42 -0600 Subject: Create 404 page for invalid ids --- model/Category.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'model/Category.php') diff --git a/model/Category.php b/model/Category.php index 5a2c11c..1b699fb 100644 --- a/model/Category.php +++ b/model/Category.php @@ -18,7 +18,7 @@ class Category { } if (mysqli_num_rows($result) == 0) { - echo 'Category does not exist!'; + return 0; } else { while ($row = mysqli_fetch_assoc($result)) { $this->id = $id; @@ -30,6 +30,7 @@ class Category { } mysqli_free_result($result); + return 1; } function get_threads($dbc) { -- cgit v1.2.3