diff --git a/system/codeigniter/Common.php b/system/codeigniter/Common.php
index c8078bf..06e9220 100644
--- a/system/codeigniter/Common.php
+++ b/system/codeigniter/Common.php
@@ -207,7 +207,6 @@
$LOG->write_log($level, $message, $php_error);
}
-
/**
* Exception Handler
*
diff --git a/system/database/DB_result.php b/system/database/DB_result.php
index 5c8b4c3..9784561 100644
--- a/system/database/DB_result.php
+++ b/system/database/DB_result.php
@@ -66,11 +66,11 @@
// In the event that query caching is on the result_id variable
// will return FALSE since there isn't a valid SQL resource so
// we'll simply return an empty array.
- if ($this->result_id === FALSE)
+ if ($this->result_id === FALSE OR $this->num_rows() == 0)
{
return array();
}
-
+
$this->_data_seek(0);
while ($row = $this->_fetch_object())
{
@@ -98,7 +98,7 @@
// In the event that query caching is on the result_id variable
// will return FALSE since there isn't a valid SQL resource so
// we'll simply return an empty array.
- if ($this->result_id === FALSE)
+ if ($this->result_id === FALSE OR $this->num_rows() == 0)
{
return array();
}
diff --git a/system/database/drivers/mssql/mssql_result.php b/system/database/drivers/mssql/mssql_result.php
index 230c1b5..eb7afef 100644
--- a/system/database/drivers/mssql/mssql_result.php
+++ b/system/database/drivers/mssql/mssql_result.php
@@ -135,7 +135,7 @@
*/
function _data_seek($n = 0)
{
- mssql_data_seek($this->result_id, $n);
+ return mssql_data_seek($this->result_id, $n);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mssql/mssql_utility.php b/system/database/drivers/mssql/mssql_utility.php
index 4a49f53..b246461 100644
--- a/system/database/drivers/mssql/mssql_utility.php
+++ b/system/database/drivers/mssql/mssql_utility.php
@@ -61,7 +61,7 @@
*/
function _drop_table($table)
{
- return "DROP TABLE ".$this->db->_escape_table($name);
+ return "DROP TABLE ".$this->db->_escape_table($table);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysql/mysql_result.php b/system/database/drivers/mysql/mysql_result.php
index 4bfaf54..9b28dea 100644
--- a/system/database/drivers/mysql/mysql_result.php
+++ b/system/database/drivers/mysql/mysql_result.php
@@ -135,7 +135,7 @@
*/
function _data_seek($n = 0)
{
- mysql_data_seek($this->result_id, $n);
+ return mysql_data_seek($this->result_id, $n);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysql/mysql_utility.php b/system/database/drivers/mysql/mysql_utility.php
index b0a7dfe..32007d2 100644
--- a/system/database/drivers/mysql/mysql_utility.php
+++ b/system/database/drivers/mysql/mysql_utility.php
@@ -73,7 +73,7 @@
*/
function _drop_table($table)
{
- return "DROP TABLE IF EXISTS ".$this->db->_escape_table($name);
+ return "DROP TABLE IF EXISTS ".$this->db->_escape_table($table);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysqli/mysqli_result.php b/system/database/drivers/mysqli/mysqli_result.php
index 5e4e65f..be7ec35 100644
--- a/system/database/drivers/mysqli/mysqli_result.php
+++ b/system/database/drivers/mysqli/mysqli_result.php
@@ -135,7 +135,7 @@
*/
function _data_seek($n = 0)
{
- mysqli_data_seek($this->result_id, $n);
+ return mysqli_data_seek($this->result_id, $n);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/mysqli/mysqli_utility.php b/system/database/drivers/mysqli/mysqli_utility.php
index a7bdb70..d5dbf2f 100644
--- a/system/database/drivers/mysqli/mysqli_utility.php
+++ b/system/database/drivers/mysqli/mysqli_utility.php
@@ -60,7 +60,7 @@
*/
function _drop_table($table)
{
- return "DROP TABLE IF EXISTS ".$this->db->_escape_table($name);
+ return "DROP TABLE IF EXISTS ".$this->db->_escape_table($table);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/postgre/postgre_result.php b/system/database/drivers/postgre/postgre_result.php
index 76bd601..f065e54 100644
--- a/system/database/drivers/postgre/postgre_result.php
+++ b/system/database/drivers/postgre/postgre_result.php
@@ -135,7 +135,7 @@
*/
function _data_seek($n = 0)
{
- pg_result_seek($this->result_id, $n);
+ return pg_result_seek($this->result_id, $n);
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/postgre/postgre_utility.php b/system/database/drivers/postgre/postgre_utility.php
index 478e742..bebe094 100644
--- a/system/database/drivers/postgre/postgre_utility.php
+++ b/system/database/drivers/postgre/postgre_utility.php
@@ -74,7 +74,7 @@
*/
function _drop_table($table)
{
- return "DROP TABLE ".$this->db->_escape_table($name)." CASCADE";
+ return "DROP TABLE ".$this->db->_escape_table($table)." CASCADE";
}
// --------------------------------------------------------------------
diff --git a/system/database/drivers/sqlite/sqlite_result.php b/system/database/drivers/sqlite/sqlite_result.php
index 00045d0..a406a93 100644
--- a/system/database/drivers/sqlite/sqlite_result.php
+++ b/system/database/drivers/sqlite/sqlite_result.php
@@ -131,7 +131,7 @@
*/
function _data_seek($n = 0)
{
- sqlite_seek($this->result_id, $n);
+ return sqlite_seek($this->result_id, $n);
}
// --------------------------------------------------------------------
diff --git a/system/libraries/Model.php b/system/libraries/Model.php
index 2fe93dd..e0335bf 100644
--- a/system/libraries/Model.php
+++ b/system/libraries/Model.php
@@ -35,13 +35,13 @@
*/
function Model()
{
- // If the magic __get() method is used in a Model references can't be used.
- $this->_assign_libraries( (method_exists($this, '__get')) ? FALSE : TRUE );
- //$this->_assign_libraries( (method_exists($this, '__get') OR method_exists('__set')) ? FALSE : TRUE );
+ // If the magic __get() or __set() methods are used in a Model references can't be used.
+ $this->_assign_libraries( (method_exists($this, '__get') OR method_exists('__set')) ? FALSE : TRUE );
// We don't want to assign the model object to itself when using the
// assign_libraries function below so we'll grab the name of the model parent
$methods = get_class_methods($this);
+
if (isset($methods[0]))
{
$this->_parent_name = $methods[0];