diff options
author | Andrey Andreev <narf@devilix.net> | 2014-05-09 09:46:11 +0200 |
---|---|---|
committer | Andrey Andreev <narf@devilix.net> | 2014-05-09 09:46:11 +0200 |
commit | 08ae84f82c9e83d5a7630d0adb621d5d638d6089 (patch) | |
tree | 1cb74bcb8520313623f36899d94a4a6683bcd00d /system/database/DB_result.php | |
parent | 2bbbd1a13ead097fd3f4b00bfb275f0b0f836f93 (diff) |
Call data_seek(0) only if we've used DB_result::*row*() methods
This should fix HHVM where it throws 'Unable to jump to row 0 on MySQL result index X' error messages for ext/mysqli
Diffstat (limited to 'system/database/DB_result.php')
-rw-r--r-- | system/database/DB_result.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/system/database/DB_result.php b/system/database/DB_result.php index 6aa4e92b6..b02d016ca 100644 --- a/system/database/DB_result.php +++ b/system/database/DB_result.php @@ -203,7 +203,7 @@ class CI_DB_result { return $this->custom_result_object[$class_name]; } - $this->data_seek(0); + is_null($this->row_data) OR $this->data_seek(0); $this->custom_result_object[$class_name] = array(); while ($row = $this->_fetch_object($class_name)) @@ -246,7 +246,7 @@ class CI_DB_result { return $this->result_object; } - $this->data_seek(0); + is_null($this->row_data) OR $this->data_seek(0); while ($row = $this->_fetch_object()) { $this->result_object[] = $row; @@ -287,7 +287,7 @@ class CI_DB_result { return $this->result_array; } - $this->data_seek(0); + is_null($this->row_data) OR $this->data_seek(0); while ($row = $this->_fetch_assoc()) { $this->result_array[] = $row; |