From faae3f3906575b9c72d628a5e48d03f943c794fc Mon Sep 17 00:00:00 2001 From: cflip <36554078+cflip@users.noreply.github.com> Date: Sat, 17 Apr 2021 17:36:18 -0600 Subject: Automatically sort threads without PHP comparisons --- model/Category.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'model') diff --git a/model/Category.php b/model/Category.php index 1b699fb..b7c46d9 100644 --- a/model/Category.php +++ b/model/Category.php @@ -34,7 +34,7 @@ class Category { } function get_threads($dbc) { - $sql = "SELECT thread_id FROM threads WHERE thread_category = " . $this->id . " ORDER BY thread_date_lastpost"; + $sql = "SELECT thread_id FROM threads WHERE thread_category = " . $this->id . " ORDER BY thread_date_lastpost DESC"; $result = mysqli_query($dbc, $sql); if (!$result) { @@ -80,7 +80,7 @@ class Category { } function get_all_categories($dbc) { - $sql = "SELECT cat_id FROM categories"; + $sql = "SELECT cat_id FROM categories ORDER BY cat_id ASC;"; $result = mysqli_query($dbc, $sql); if (!$result) { -- cgit v1.2.3