From 098700aa6c409b844fd38299156927e4cd12a3b2 Mon Sep 17 00:00:00 2001 From: icewing Date: Wed, 28 May 2008 11:21:05 +0000 Subject: Marcus Povey * Fixed order/limit git-svn-id: https://code.elgg.org/elgg/trunk@738 36083f99-b078-4883-b0ff-0f9b5a30f544 --- engine/lib/database.php | 8 +++++--- 1 file 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); -- cgit v1.2.3