\CI_DB_mysql_result

MySQL Result Class

This class extends the parent result class: CI_DB_result

Summary

Methods
Properties
Constants
result()
custom_result_object()
result_object()
result_array()
row()
set_row()
custom_row_object()
row_object()
row_array()
first_row()
last_row()
next_row()
previous_row()
num_rows()
num_fields()
list_fields()
field_data()
free_result()
_data_seek()
_fetch_assoc()
_fetch_object()
$conn_id
$result_id
$result_array
$result_object
$custom_result_object
$current_row
$num_rows
$row_data
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$conn_id

$conn_id : 

Type

$result_id

$result_id : 

Type

$result_array

$result_array : 

Type

$result_object

$result_object : 

Type

$custom_result_object

$custom_result_object : 

Type

$current_row

$current_row : 

Type

$num_rows

$num_rows : 

Type

$row_data

$row_data : 

Type

Methods

result()

result(  $type = 'object') : mixed

Query result. Acts as a wrapper function for the following functions.

Parameters

$type

Returns

mixed —

either a result object or array

custom_result_object()

custom_result_object(  $class_name) : array

Custom query result.

Parameters

$class_name

Returns

array —

of objects

result_object()

result_object() : object

Query result. "object" version.

Returns

object

result_array()

result_array() : array

Query result. "array" version.

Returns

array

row()

row(  $n,   $type = 'object') : mixed

Query result. Acts as a wrapper function for the following functions.

Parameters

$n
$type

Returns

mixed —

either a result object or array

set_row()

set_row(  $key,   $value = NULL) : object

Assigns an item into a particular column slot

Parameters

$key
$value

Returns

object

custom_row_object()

custom_row_object(  $n,   $type) : object

Returns a single result row - custom object version

Parameters

$n
$type

Returns

object

row_object()

row_object(  $n) : object

Returns a single result row - object version

Parameters

$n

Returns

object

row_array()

row_array(  $n) : array

Returns a single result row - array version

Parameters

$n

Returns

array

first_row()

first_row(  $type = 'object') : object

Returns the "first" row

Parameters

$type

Returns

object

last_row()

last_row(  $type = 'object') : object

Returns the "last" row

Parameters

$type

Returns

object

next_row()

next_row(  $type = 'object') : object

Returns the "next" row

Parameters

$type

Returns

object

previous_row()

previous_row(  $type = 'object') : object

Returns the "previous" row

Parameters

$type

Returns

object

num_rows()

num_rows() : integer

Number of rows in the result set

These functions are primarily here to prevent undefined function errors when a cached result object is in use. They are not otherwise fully operational due to the unavailability of the database resource IDs with cached results.

Returns

integer

num_fields()

num_fields() : integer

Number of fields in the result set

Returns

integer

list_fields()

list_fields() : array

Fetch Field Names

Generates an array of column names

Returns

array

field_data()

field_data() : array

Field data

Generates an array of objects containing field meta-data

Returns

array

free_result()

free_result() : null

Free the result

Returns

null

_data_seek()

_data_seek(  $n) : array

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

Parameters

$n

Returns

array

_fetch_assoc()

_fetch_assoc() : array

Result - associative array

Returns the result set as an array

Returns

array

_fetch_object()

_fetch_object() : object

Result - object

Returns the result set as an object

Returns

object