summaryrefslogtreecommitdiffstats
path: root/system/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'system/libraries')
-rw-r--r--system/libraries/Controller.php3
-rw-r--r--system/libraries/Table.php8
2 files changed, 7 insertions, 4 deletions
diff --git a/system/libraries/Controller.php b/system/libraries/Controller.php
index 938c46e4c..88ab46164 100644
--- a/system/libraries/Controller.php
+++ b/system/libraries/Controller.php
@@ -75,8 +75,7 @@ class Controller extends CI_Base {
{
$this->$var =& load_class($class);
}
-
-
+
// In PHP 5 the Controller class is run as a discreet
// class. In PHP 4 it extends the Controller
if (floor(phpversion()) >= 5)
diff --git a/system/libraries/Table.php b/system/libraries/Table.php
index 0f2c49d96..61d04eef5 100644
--- a/system/libraries/Table.php
+++ b/system/libraries/Table.php
@@ -211,9 +211,13 @@ class CI_Table {
}
// Next blast through the result array and build out the rows
- foreach ($query->result_array() as $row)
+
+ if ($query->num_rows() > 0)
{
- $this->rows[] = $row;
+ foreach ($query->result_array() as $row)
+ {
+ $this->rows[] = $row;
+ }
}
}