summaryrefslogtreecommitdiff
path: root/model/Category.php
diff options
context:
space:
mode:
authorcflip <36554078+cflip@users.noreply.github.com>2021-04-17 17:36:18 -0600
committercflip <36554078+cflip@users.noreply.github.com>2021-04-17 17:36:18 -0600
commitfaae3f3906575b9c72d628a5e48d03f943c794fc (patch)
treeae3290ba4a1377f95f5c2081ffebe7124958872c /model/Category.php
parent0b045d57b2164b5ce003955d79627ae506a153eb (diff)
Automatically sort threads without PHP comparisons
Diffstat (limited to 'model/Category.php')
-rw-r--r--model/Category.php4
1 files changed, 2 insertions, 2 deletions
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) {