aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/database.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index 73d22d28f..f18603d8c 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -516,13 +516,15 @@
else
throw new DatabaseException("No access control was provided on query");
+ // Order by
+ if (!empty($this->order))
+ $sql .= "{$this->order} ";
+
// Limits
if (!empty($this->limit_and_offset))
$sql .= "{$this->limit_and_offset} ";
- // Order by
- if (!empty($this->order))
- $sql .= $this->order;
+
} catch (Exception $e) {
trigger_error($e, E_USER_WARNING);