Skip to content
This repository has been archived by the owner on Feb 12, 2020. It is now read-only.

Commit

Permalink
Add Unbuffered Query to CodeIgniter Core 1.0
Browse files Browse the repository at this point in the history
Core file should not be touched but this feature recommended for large datasets. New CodeIgniter already supports this. Copied from New version.
  • Loading branch information
anup-khanal committed Oct 24, 2017
1 parent ff5d0b2 commit 12c35e6
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions system/database/DB_result.php
Expand Up @@ -396,6 +396,28 @@ public function previous_row($type = 'object')
* cached results.
*/
public function num_rows() { return $this->num_rows; }
// --------------------------------------------------------------------

/**
* Returns an unbuffered row and move pointer to next row
*
* @param string $type 'array', 'object' or a custom class name
* @return mixed
*/
public function unbuffered_row($type = 'object')
{
if ($type === 'array')
{
return $this->_fetch_assoc();
}
elseif ($type === 'object')
{
return $this->_fetch_object();
}

return $this->_fetch_object($type);
}

public function num_fields() { return 0; }
public function list_fields() { return array(); }
public function field_data() { return array(); }
Expand Down

0 comments on commit 12c35e6

Please sign in to comment.