CI_DB_sqlite_result Class Reference

Inheritance diagram for CI_DB_sqlite_result:
Collaboration diagram for CI_DB_sqlite_result:

List of all members.


Public Member Functions

 num_rows ()
 Number of rows in the result set.
 num_fields ()
 Number of fields in the result set.
 list_fields ()
 Fetch Field Names.
 field_data ()
 Field data.
 free_result ()
 Free the result.
 _data_seek ($n=0)
 Data Seek.
 _fetch_assoc ()
 Result - associative array.
 _fetch_object ()
 Result - object.

Detailed Description

Definition at line 27 of file sqlite_result.php.


Member Function Documentation

CI_DB_sqlite_result::_data_seek ( n = 0  ) 

Data Seek.

Moves the internal pointer to the desired offset. We call this internally before fetching results to make sure the result set starts at zero

private

Returns:
array

Definition at line 126 of file sqlite_result.php.

00127         {
00128                 return sqlite_seek($this->result_id, $n);
00129         }

CI_DB_sqlite_result::_fetch_assoc (  ) 

Result - associative array.

Returns the result set as an array

private

Returns:
array

Reimplemented from CI_DB_result.

Definition at line 141 of file sqlite_result.php.

00142         {
00143                 return sqlite_fetch_array($this->result_id);
00144         }

CI_DB_sqlite_result::_fetch_object (  ) 

Result - object.

Returns the result set as an object

private

Returns:
object

Reimplemented from CI_DB_result.

Definition at line 156 of file sqlite_result.php.

00157         {
00158                 if (function_exists('sqlite_fetch_object'))
00159                 {
00160                         return sqlite_fetch_object($this->result_id);
00161                 }
00162                 else
00163                 {
00164                         $arr = sqlite_fetch_array($this->result_id, SQLITE_ASSOC);
00165                         if (is_array($arr))
00166                         {
00167                                 $obj = (object) $arr;
00168                                 return $obj;
00169                         } else {
00170                                 return NULL;
00171                         } 
00172                 }
00173         }

CI_DB_sqlite_result::field_data (  ) 

Field data.

Generates an array of objects containing field meta-data

public

Returns:
array

Reimplemented from CI_DB_result.

Definition at line 84 of file sqlite_result.php.

References num_fields().

00085         {
00086                 $retval = array();
00087                 for ($i = 0; $i < $this->num_fields(); $i++)
00088                 {
00089                         $F                              = new stdClass();
00090                         $F->name                = sqlite_field_name($this->result_id, $i);
00091                         $F->type                = 'varchar';
00092                         $F->max_length  = 0;
00093                         $F->primary_key = 0;
00094                         $F->default             = '';
00095 
00096                         $retval[] = $F;
00097                 }
00098                 
00099                 return $retval;
00100         }

Here is the call graph for this function:

CI_DB_sqlite_result::free_result (  ) 

Free the result.

Returns:
null

Reimplemented from CI_DB_result.

Definition at line 109 of file sqlite_result.php.

00110         {
00111                 // Not implemented in SQLite
00112         }

CI_DB_sqlite_result::list_fields (  ) 

Fetch Field Names.

Generates an array of column names

public

Returns:
array

Reimplemented from CI_DB_result.

Definition at line 63 of file sqlite_result.php.

References num_fields().

00064         {
00065                 $field_names = array();
00066                 for ($i = 0; $i < $this->num_fields(); $i++)
00067                 {
00068                         $field_names[] = sqlite_field_name($this->result_id, $i);
00069                 }
00070                 
00071                 return $field_names;
00072         }

Here is the call graph for this function:

CI_DB_sqlite_result::num_fields (  ) 

Number of fields in the result set.

public

Returns:
integer

Reimplemented from CI_DB_result.

Definition at line 48 of file sqlite_result.php.

Referenced by field_data(), and list_fields().

00049         {
00050                 return @sqlite_num_fields($this->result_id);
00051         }

Here is the caller graph for this function:

CI_DB_sqlite_result::num_rows (  ) 

Number of rows in the result set.

public

Returns:
integer

Reimplemented from CI_DB_result.

Definition at line 35 of file sqlite_result.php.

00036         {
00037                 return @sqlite_num_rows($this->result_id);
00038         }


The documentation for this class was generated from the following file: