From 7f31dfa2af082735151e489e08819ede70e662f0 Mon Sep 17 00:00:00 2001 From: Dmitriy Simushev Date: Thu, 10 Nov 2011 16:05:34 +0000 Subject: [PATCH] Changed perform_query function. It now returns a reference to the query result --- src/messenger/webim/libs/common.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/messenger/webim/libs/common.php b/src/messenger/webim/libs/common.php index bdf9e735..ef5916e4 100644 --- a/src/messenger/webim/libs/common.php +++ b/src/messenger/webim/libs/common.php @@ -400,7 +400,11 @@ function db_fetch_assoc($result){ function perform_query($query, $link) { - mysql_query($query, $link) or die(' Query failed: ' . db_error($link)); + $result = mysql_query($query, $link); + if (! $result) { + die(' Query failed: ' . db_error($link)); + } + return $result; } function select_one_row($query, $link)