From 12e7d3492961fb9ea20a60eb2a94371d97f9b61c Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Thu, 10 Nov 2011 16:21:23 +0000 Subject: [PATCH] Replaced all mysql_query by perform_query, except for the directory /install --- src/messenger/webim/libs/common.php | 11 +++++------ src/messenger/webim/operator/history.php | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index ef5916e4..b63303c7 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -358,7 +358,7 @@ function connect() } mysql_select_db($mysqldb, $link) or die('Could not select database'); if ($force_charset_in_connection) { - mysql_query("SET NAMES '$dbencoding'", $link); + perform_query("SET NAMES '$dbencoding'", $link); } return $link; } @@ -409,7 +409,7 @@ function perform_query($query, $link) function select_one_row($query, $link) { - $result = mysql_query($query, $link) or die(' Query failed: ' . db_error($link)); + $result = perform_query($query, $link); $line = db_fetch_assoc($result); mysql_free_result($result); return $line; @@ -417,7 +417,7 @@ function select_one_row($query, $link) function select_multi_assoc($query, $link) { - $sqlresult = mysql_query($query, $link) or die(' Query failed: ' . db_error($link)); + $sqlresult = perform_query($query, $link); $result = array(); while ($row = db_fetch_assoc($sqlresult)) { @@ -436,8 +436,7 @@ function db_build_select($fields, $table, $conditions, $orderandgroup) function db_rows_count($table, $conditions, $countfields, $link) { - $result = mysql_query(db_build_select("count(" . ($countfields ? $countfields : "*") . ")", $table, $conditions, ""), $link) - or die(' Count query failed: ' . db_error($link)); + $result = perform_query(db_build_select("count(" . ($countfields ? $countfields : "*") . ")", $table, $conditions, ""), $link); $line = db_fetch_row($result); mysql_free_result($result); return $line[0]; @@ -702,7 +701,7 @@ function loadsettings_($link) } $settingsloaded = true; - $sqlresult = mysql_query("select vckey,vcvalue from ${mysqlprefix}chatconfig", $link) or die(' Query failed: ' . db_error($link)); + $sqlresult = perform_query("select vckey,vcvalue from ${mysqlprefix}chatconfig", $link); while ($row = db_fetch_assoc($sqlresult)) { $name = $row['vckey']; diff --git a/src/messenger/webim/operator/history.php b/src/messenger/webim/operator/history.php index e9c53f2b..608e33f8 100644 --- a/src/messenger/webim/operator/history.php +++ b/src/messenger/webim/operator/history.php @@ -38,7 +38,7 @@ $query = isset($_GET['q']) ? myiconv(getoutputenc(), $webim_encoding, $_GET['q'] if ($query !== false) { $link = connect(); - $result = mysql_query("select ${mysqlprefix}chatgroup.groupid as groupid, vclocalname " . + $result = perform_query("select ${mysqlprefix}chatgroup.groupid as groupid, vclocalname " . "from ${mysqlprefix}chatgroup order by vclocalname", $link); $groupName = array(); while ($group = db_fetch_assoc($result)) {