From 3e5834983ffb40c4b67e84a887d0f2f061799716 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Wed, 9 Nov 2011 20:10:04 +0000 Subject: [PATCH] Replaced all mysql_error by db_error except for the directory /install --- src/messenger/webim/libs/common.php | 10 +++++----- src/messenger/webim/operator/blocked.php | 2 +- src/messenger/webim/operator/userhistory.php | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index cafdb61c..b1e34cad 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -386,12 +386,12 @@ function db_error($link) function perform_query($query, $link) { - mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link)); + mysql_query($query, $link) or die(' Query failed: ' . db_error($link)); } function select_one_row($query, $link) { - $result = mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link)); + $result = mysql_query($query, $link) or die(' Query failed: ' . db_error($link)); $line = mysql_fetch_array($result, MYSQL_ASSOC); mysql_free_result($result); return $line; @@ -399,7 +399,7 @@ function select_one_row($query, $link) function select_multi_assoc($query, $link) { - $sqlresult = mysql_query($query, $link) or die(' Query failed: ' . mysql_error($link)); + $sqlresult = mysql_query($query, $link) or die(' Query failed: ' . db_error($link)); $result = array(); while ($row = mysql_fetch_array($sqlresult, MYSQL_ASSOC)) { @@ -419,7 +419,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: ' . mysql_error($link)); + or die(' Count query failed: ' . db_error($link)); $line = mysql_fetch_array($result, MYSQL_NUM); mysql_free_result($result); return $line[0]; @@ -684,7 +684,7 @@ function loadsettings_($link) } $settingsloaded = true; - $sqlresult = mysql_query("select vckey,vcvalue from ${mysqlprefix}chatconfig", $link) or die(' Query failed: ' . mysql_error($link)); + $sqlresult = mysql_query("select vckey,vcvalue from ${mysqlprefix}chatconfig", $link) or die(' Query failed: ' . db_error($link)); while ($row = mysql_fetch_array($sqlresult, MYSQL_ASSOC)) { $name = $row['vckey']; diff --git a/src/messenger/webim/operator/blocked.php b/src/messenger/webim/operator/blocked.php index abbdc80e..4e5d9100 100644 --- a/src/messenger/webim/operator/blocked.php +++ b/src/messenger/webim/operator/blocked.php @@ -47,7 +47,7 @@ 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: ' . mysql_error($link)); + or die(' Query failed: ' . db_error($link)); $blockedList = array(); while ($ban = mysql_fetch_array($result, MYSQL_ASSOC)) { diff --git a/src/messenger/webim/operator/userhistory.php b/src/messenger/webim/operator/userhistory.php index 41b66845..5c6c8db6 100644 --- a/src/messenger/webim/operator/userhistory.php +++ b/src/messenger/webim/operator/userhistory.php @@ -50,7 +50,7 @@ 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: ' . mysql_error($link)); + $result = mysql_query($query, $link) or die(' Query failed: ' . db_error($link)); $foundThreads = array(); while ($thread = mysql_fetch_array($result, MYSQL_ASSOC)) {