diff options
Diffstat (limited to 'engine/lib/database.php')
-rw-r--r-- | engine/lib/database.php | 8 |
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); |