From a295c210a2b09a12cfd5da24a3030ecca2c0d386 Mon Sep 17 00:00:00 2001 From: Shish Date: Tue, 2 Feb 2010 13:15:24 +0000 Subject: [PATCH] limit/offset incompatability blah --- ext/alias_editor/main.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/alias_editor/main.php b/ext/alias_editor/main.php index 831c5f89..99a12213 100644 --- a/ext/alias_editor/main.php +++ b/ext/alias_editor/main.php @@ -70,8 +70,13 @@ class AliasEditor implements Extension { $alias_per_page = $config->get_int('alias_items_per_page', 30); - $alias = $database->db->GetAssoc( - "SELECT oldtag, newtag FROM aliases ORDER BY newtag ASC OFFSET ? LIMIT ?", + if($database->engine->name == "mysql") { + $query = "SELECT oldtag, newtag FROM aliases ORDER BY newtag ASC LIMIT ?, ?"; + } + else { + $query = "SELECT oldtag, newtag FROM aliases ORDER BY newtag ASC OFFSET ? LIMIT ?"; + } + $alias = $database->db->GetAssoc($query, array($page_number * $alias_per_page, $alias_per_page) );