summaryrefslogtreecommitdiffstats
path: root/system/database/drivers/mysql
diff options
context:
space:
mode:
authorRick Ellis <rick.ellis@ellislab.com>2008-09-30 22:38:12 +0200
committerRick Ellis <rick.ellis@ellislab.com>2008-09-30 22:38:12 +0200
commitff73401cdef0136c15c6dab95d4d722123668e7a (patch)
treea9d04ceca35fb777cdd769a1b093821d195de230 /system/database/drivers/mysql
parent8f99224e6c6d3ac51cb0f356e2e0feb10fa93f31 (diff)
Did a little clean up. Nothing that affected functionality
Diffstat (limited to 'system/database/drivers/mysql')
-rw-r--r--system/database/drivers/mysql/mysql_driver.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/system/database/drivers/mysql/mysql_driver.php b/system/database/drivers/mysql/mysql_driver.php
index de372e669..52df1e591 100644
--- a/system/database/drivers/mysql/mysql_driver.php
+++ b/system/database/drivers/mysql/mysql_driver.php
@@ -314,6 +314,9 @@ class CI_DB_mysql_driver extends CI_DB {
$query = $this->query($this->_count_string . $this->_protect_identifiers('numrows'). " FROM " . $this->_protect_identifiers($this->dbprefix.$table));
+ if ($query->num_rows() == 0)
+ return '0';
+
$row = $query->row();
return (int)$row->numrows;
}