aboutsummaryrefslogtreecommitdiff
path: root/engine/lib
diff options
context:
space:
mode:
authoricewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-14 15:18:25 +0000
committericewing <icewing@36083f99-b078-4883-b0ff-0f9b5a30f544>2008-05-14 15:18:25 +0000
commit5f4c987b91f5f75f9a0c5ef20ed7edcacc110a26 (patch)
tree8487d80f5f0bedab382d3af50402c364a3794aa8 /engine/lib
parent3ad2b9575fa8aec0b5fb17e6de6b76a95f7b17c5 (diff)
downloadelgg-5f4c987b91f5f75f9a0c5ef20ed7edcacc110a26.tar.gz
elgg-5f4c987b91f5f75f9a0c5ef20ed7edcacc110a26.tar.bz2
Marcus Povey <marcus@dushka.co.uk>
* Debug mode causes queries that return no data to issue a warning git-svn-id: https://code.elgg.org/elgg/trunk@644 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'engine/lib')
-rw-r--r--engine/lib/database.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/engine/lib/database.php b/engine/lib/database.php
index 0979592c0..fef31e682 100644
--- a/engine/lib/database.php
+++ b/engine/lib/database.php
@@ -153,6 +153,9 @@
throw new DatabaseException(mysql_error($dblink) . " QUERY: " . $query);
if (empty($resultarray)) {
+ if ((isset($CONFIG->debug)) && ($CONFIG->debug==true))
+ error_log("WARNING: DB query \"$query\" returned no results.");
+
return false;
}
return $resultarray;
@@ -186,7 +189,10 @@
if (mysql_errno($dblink))
throw new DatabaseException(mysql_error($dblink) . " QUERY: " . $query);
-
+
+ if ((isset($CONFIG->debug)) && ($CONFIG->debug==true))
+ error_log("WARNING: DB query \"$query\" returned no results.");
+
return false;
}