From 20701ad5da948f97f2c9de9ceb72eafd73cf3516 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Thu, 10 Nov 2011 11:13:11 +0000 Subject: [PATCH] Replaced reciving associative arrays from database by select_multi_assoc function --- src/messenger/webim/operator/blocked.php | 9 +-------- src/messenger/webim/operator/userhistory.php | 8 +------- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/messenger/webim/operator/blocked.php b/src/messenger/webim/operator/blocked.php index 4e5d9100..3a32d2e1 100644 --- a/src/messenger/webim/operator/blocked.php +++ b/src/messenger/webim/operator/blocked.php @@ -46,15 +46,8 @@ if (isset($_GET['act']) && $_GET['act'] == 'del') { } } -$result = mysql_query("select banid,unix_timestamp(dtmtill) as till,address,comment from ${mysqlprefix}chatban", $link) - or die(' Query failed: ' . db_error($link)); +$blockedList = select_multi_assoc("select banid,unix_timestamp(dtmtill) as till,address,comment from ${mysqlprefix}chatban", $link); -$blockedList = array(); -while ($ban = mysql_fetch_array($result, MYSQL_ASSOC)) { - $blockedList[] = $ban; -} - -mysql_free_result($result); close_connection($link); setup_pagination($blockedList); diff --git a/src/messenger/webim/operator/userhistory.php b/src/messenger/webim/operator/userhistory.php index 5c6c8db6..0914dd93 100644 --- a/src/messenger/webim/operator/userhistory.php +++ b/src/messenger/webim/operator/userhistory.php @@ -50,14 +50,8 @@ function threads_by_userid($userid) "from ${mysqlprefix}chatthread " . "where userid=\"$userid\" order by created DESC", $userid); - $result = mysql_query($query, $link) or die(' Query failed: ' . db_error($link)); + $foundThreads = select_multi_assoc($query, $link); - $foundThreads = array(); - while ($thread = mysql_fetch_array($result, MYSQL_ASSOC)) { - $foundThreads[] = $thread; - } - - mysql_free_result($result); close_connection($link); return $foundThreads; }