From 5f4c987b91f5f75f9a0c5ef20ed7edcacc110a26 Mon Sep 17 00:00:00 2001 From: icewing Date: Wed, 14 May 2008 15:18:25 +0000 Subject: Marcus Povey * 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 --- engine/lib/database.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.3