Replaced reciving associative arrays from database by select_multi_assoc function

This commit is contained in:
Dmitriy Simushev 2011-11-10 11:13:11 +00:00
parent 720c4472d3
commit 20701ad5da
2 changed files with 2 additions and 15 deletions

View File

@ -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) $blockedList = select_multi_assoc("select banid,unix_timestamp(dtmtill) as till,address,comment from ${mysqlprefix}chatban", $link);
or die(' Query failed: ' . db_error($link));
$blockedList = array();
while ($ban = mysql_fetch_array($result, MYSQL_ASSOC)) {
$blockedList[] = $ban;
}
mysql_free_result($result);
close_connection($link); close_connection($link);
setup_pagination($blockedList); setup_pagination($blockedList);

View File

@ -50,14 +50,8 @@ function threads_by_userid($userid)
"from ${mysqlprefix}chatthread " . "from ${mysqlprefix}chatthread " .
"where userid=\"$userid\" order by created DESC", $userid); "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); close_connection($link);
return $foundThreads; return $foundThreads;
} }