From 53560c521e594d6047f58a25ccbc266c56bbcf05 Mon Sep 17 00:00:00 2001 From: svncommit Date: Thu, 20 Oct 2005 16:58:34 +0000 Subject: added DB LIMIT abstraction --- program/steps/addressbook/delete.inc | 7 +++---- program/steps/addressbook/func.inc | 7 +++---- program/steps/addressbook/list.inc | 7 +++---- 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'program/steps/addressbook') diff --git a/program/steps/addressbook/delete.inc b/program/steps/addressbook/delete.inc index 789d84149..e988f5569 100644 --- a/program/steps/addressbook/delete.inc +++ b/program/steps/addressbook/delete.inc @@ -65,12 +65,11 @@ if ($_GET['_cid']) $sql_result = $DB->query(sprintf("SELECT * FROM %s WHERE del!='1' AND user_id=%d - ORDER BY name - LIMIT %d, %d", + ORDER BY name", get_table_name('contacts'), - $_SESSION['user_id'], + $_SESSION['user_id']), $start_row, - $count)); + $count); $commands .= rcmail_js_contacts_list($sql_result); diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index 7858a4e88..53628162b 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -59,12 +59,11 @@ function rcmail_contacts_list($attrib) $sql_result = $DB->query(sprintf("SELECT * FROM %s WHERE del!='1' AND user_id=%d - ORDER BY name - LIMIT %d, %d", + ORDER BY name", get_table_name('contacts'), - $_SESSION['user_id'], + $_SESSION['user_id']), $start_row, - $CONFIG['pagesize'])); + $CONFIG['pagesize']); } else $sql_result = NULL; diff --git a/program/steps/addressbook/list.inc b/program/steps/addressbook/list.inc index 2c5148a91..4ed092541 100644 --- a/program/steps/addressbook/list.inc +++ b/program/steps/addressbook/list.inc @@ -43,12 +43,11 @@ $start_row = ($CONTACTS_LIST['page']-1) * $CONFIG['pagesize']; $sql_result = $DB->query(sprintf("SELECT * FROM %s WHERE del!='1' AND user_id=%d - ORDER BY name - LIMIT %d, %d", + ORDER BY name", get_table_name('contacts'), - $_SESSION['user_id'], + $_SESSION['user_id']), $start_row, - $CONFIG['pagesize'])); + $CONFIG['pagesize']); $commands .= rcmail_js_contacts_list($sql_result); -- cgit v1.2.3