1 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
5 * An open source application development framework for PHP 5.1.6 or newer
8 * @author ExpressionEngine Dev Team
9 * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc.
10 * @license http://codeigniter.com/user_guide/license.html
11 * @link http://codeigniter.com
16 // ------------------------------------------------------------------------
21 * This class extends the parent result class: CI_DB_result
24 * @author ExpressionEngine Dev Team
25 * @link http://codeigniter.com/user_guide/database/
27 class CI_DB_sqlite_result extends CI_DB_result {
30 * Number of rows in the result set
37 return @sqlite_num_rows($this->result_id);
40 // --------------------------------------------------------------------
43 * Number of fields in the result set
50 return @sqlite_num_fields($this->result_id);
53 // --------------------------------------------------------------------
58 * Generates an array of column names
63 function list_fields()
65 $field_names = array();
66 for ($i = 0; $i < $this->num_fields(); $i++)
68 $field_names[] = sqlite_field_name($this->result_id, $i);
74 // --------------------------------------------------------------------
79 * Generates an array of objects containing field meta-data
87 for ($i = 0; $i < $this->num_fields(); $i++)
90 $F->name = sqlite_field_name($this->result_id, $i);
102 // --------------------------------------------------------------------
109 function free_result()
111 // Not implemented in SQLite
114 // --------------------------------------------------------------------
119 * Moves the internal pointer to the desired offset. We call
120 * this internally before fetching results to make sure the
121 * result set starts at zero
126 function _data_seek($n = 0)
128 return sqlite_seek($this->result_id, $n);
131 // --------------------------------------------------------------------
134 * Result - associative array
136 * Returns the result set as an array
141 function _fetch_assoc()
143 return sqlite_fetch_array($this->result_id);
146 // --------------------------------------------------------------------
151 * Returns the result set as an object
156 function _fetch_object()
158 if (function_exists('sqlite_fetch_object'))
160 return sqlite_fetch_object($this->result_id);
164 $arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC);
167 $obj = (object) $arr;
178 /* End of file sqlite_result.php */
179 /* Location: ./system/database/drivers/sqlite/sqlite_result.php */