CI_DB_odbc_result Class Reference

Inheritance diagram for CI_DB_odbc_result:
Collaboration diagram for CI_DB_odbc_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.
 _odbc_fetch_object (&$odbc_result)
 Result - object.
 _odbc_fetch_array (&$odbc_result)
 Result - array.

Detailed Description

Definition at line 27 of file odbc_result.php.


Member Function Documentation

CI_DB_odbc_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 130 of file odbc_result.php.

00131         {
00132                 return FALSE;
00133         }

CI_DB_odbc_result::_fetch_assoc (  ) 

Result - associative array.

Returns the result set as an array

private

Returns:
array

Reimplemented from CI_DB_result.

Definition at line 145 of file odbc_result.php.

References _odbc_fetch_array().

00146         {
00147                 if (function_exists('odbc_fetch_object'))
00148                 {
00149                         return odbc_fetch_array($this->result_id);
00150                 }
00151                 else
00152                 {
00153                         return $this->_odbc_fetch_array($this->result_id);
00154                 }
00155         }

Here is the call graph for this function:

CI_DB_odbc_result::_fetch_object (  ) 

Result - object.

Returns the result set as an object

private

Returns:
object

Reimplemented from CI_DB_result.

Definition at line 167 of file odbc_result.php.

References _odbc_fetch_object().

00168         {
00169                 if (function_exists('odbc_fetch_object'))
00170                 {
00171                         return odbc_fetch_object($this->result_id);
00172                 }
00173                 else
00174                 {
00175                         return $this->_odbc_fetch_object($this->result_id);
00176                 }
00177         }

Here is the call graph for this function:

CI_DB_odbc_result::_odbc_fetch_array ( &$  odbc_result  ) 

Result - array.

subsititutes the odbc_fetch_array function when not available (odbc_fetch_array requires unixODBC)

private

Returns:
array

Definition at line 211 of file odbc_result.php.

Referenced by _fetch_assoc().

00211                                                    {
00212                 $rs = array();
00213                 $rs_assoc = false;
00214                 if (odbc_fetch_into($odbc_result, $rs)) {
00215                         $rs_assoc=array();
00216                         foreach ($rs as $k=>$v) {
00217                                 $field_name= odbc_field_name($odbc_result, $k+1);
00218                                 $rs_assoc[$field_name] = $v;
00219                         }
00220                 }
00221                 return $rs_assoc;
00222         }

Here is the caller graph for this function:

CI_DB_odbc_result::_odbc_fetch_object ( &$  odbc_result  ) 

Result - object.

subsititutes the odbc_fetch_object function when not available (odbc_fetch_object requires unixODBC)

private

Returns:
object

Definition at line 189 of file odbc_result.php.

Referenced by _fetch_object().

00189                                                     {
00190                 $rs = array();
00191                 $rs_obj = false;
00192                 if (odbc_fetch_into($odbc_result, $rs)) {
00193                         foreach ($rs as $k=>$v) {
00194                                 $field_name= odbc_field_name($odbc_result, $k+1);
00195                                 $rs_obj->$field_name = $v;
00196                         }
00197                 }
00198                 return $rs_obj;
00199         }

Here is the caller graph for this function:

CI_DB_odbc_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 odbc_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                = odbc_field_name($this->result_id, $i);
00091                         $F->type                = odbc_field_type($this->result_id, $i);
00092                         $F->max_length  = odbc_field_len($this->result_id, $i);
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_odbc_result::free_result (  ) 

Free the result.

Returns:
null

Reimplemented from CI_DB_result.

Definition at line 109 of file odbc_result.php.

00110         {
00111                 if (is_resource($this->result_id))
00112                 {
00113                         odbc_free_result($this->result_id);
00114                         $this->result_id = FALSE;
00115                 }
00116         }

CI_DB_odbc_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 odbc_result.php.

References num_fields().

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

Here is the call graph for this function:

CI_DB_odbc_result::num_fields (  ) 

Number of fields in the result set.

public

Returns:
integer

Reimplemented from CI_DB_result.

Definition at line 48 of file odbc_result.php.

Referenced by field_data(), and list_fields().

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

Here is the caller graph for this function:

CI_DB_odbc_result::num_rows (  ) 

Number of rows in the result set.

public

Returns:
integer

Reimplemented from CI_DB_result.

Definition at line 35 of file odbc_result.php.

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


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