summaryrefslogtreecommitdiff
path: root/system/libraries
diff options
context:
space:
mode:
authorRomain LE DISEZ <romain.git@ledisez.net>2009-07-22 08:38:06 +0200
committerRomain LE DISEZ <romain.git@ledisez.net>2009-07-22 08:38:06 +0200
commit317b7b98c094386407251c2baf8f6e7c391c7bff (patch)
tree98898d791df3a10cf6f9c1c62fbce06d8c9a7de1 /system/libraries
parent00b3ca82de3a4858745988943a46d07b1c0fd006 (diff)
parentf533aee1cc71e8db739406859ac0cf43dce030ec (diff)
Merge commit 'upstream/master'
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Database.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/system/libraries/Database.php b/system/libraries/Database.php
index 6267f63a..2039371c 100644
--- a/system/libraries/Database.php
+++ b/system/libraries/Database.php
@@ -2,7 +2,7 @@
/**
* Provides database access in a platform agnostic way, using simple query building blocks.
*
- * $Id: Database.php 4342 2009-05-08 16:56:01Z jheathco $
+ * $Id: Database.php 4438 2009-07-06 04:11:16Z kiall $
*
* @package Core
* @author Kohana Team
@@ -1144,7 +1144,12 @@ class Database_Core {
$query = $this->select('COUNT(*) AS '.$this->escape_column('records_found'))->get()->result(TRUE);
- return (int) $query->current()->records_found;
+ $query = $query->current();
+
+ if ( ! $query)
+ return 0;
+ else
+ return (int) $query->records_found;
}
/**