From fd9e71c91b4f26a1a9a18c740553e1d72a733f23 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 17 Mar 2006 16:51:28 +0000 Subject: [PATCH] Reduce errors when a query fails in query_first() --- db.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/db.php b/db.php index 0b33108..65f76ad 100644 --- a/db.php +++ b/db.php @@ -327,9 +327,16 @@ class DB_Abstract function query_first($string, $callback = 'fetch_array') { $resource = $this->query($string); - $return = $this->$callback($resource); - $this->free_result($resource); - return $return; + if ($resource) + { + $return = $this->$callback($resource); + $this->free_result($resource); + return $return; + } + else + { + return false; + } } // ################################################################### -- 2.43.5