Properties

$connID

$connID : resource|object

Connection ID

Type

resource|object

$resultID

$resultID : resource|object

Result ID

Type

resource|object

$resultArray

$resultArray : array<mixed,array>

Result Array

Type

array<mixed,array>

$resultObject

$resultObject : array<mixed,object>

Result Object

Type

array<mixed,object>

$customResultObject

$customResultObject : array<mixed,object>

Custom Result Object

Type

array<mixed,object>

$currentRow

$currentRow : integer

Current Row index

Type

integer

$numRows

$numRows : integer

Number of rows

Type

integer

$rowData

$rowData : array

Row data

Type

array

Methods

__construct()

__construct(object|resource  $connID, object|resource  $resultID) 

Constructor

Parameters

object|resource $connID
object|resource $resultID

getResult()

getResult(string  $type = 'object') : array

Retrieve the results of the query. Typically an array of individual data rows, which can be either an 'array', an 'object', or a custom class name.

Parameters

string $type

The row type. Either 'array', 'object', or a class name to use

Returns

array

getCustomResultObject()

getCustomResultObject(string  $className) : mixed

Returns the results as an array of custom objects.

Parameters

string $className

The name of the class to use.

Returns

mixed

getResultArray()

getResultArray() : array

Returns the results as an array of arrays.

If no results, an empty array is returned.

Returns

array

getResultObject()

getResultObject() : array

Returns the results as an array of objects.

If no results, an empty array is returned.

Returns

array

getRow()

getRow(mixed  $n, string  $type = 'object') : mixed

Wrapper object to return a row as either an array, an object, or a custom class.

If row doesn't exist, returns null.

Parameters

mixed $n

The index of the results to return

string $type

The type of result object. 'array', 'object' or class name.

Returns

mixed

getCustomRowObject()

getCustomRowObject(integer  $n, string  $className) : mixed

Returns a row as a custom class instance.

If row doesn't exists, returns null.

Parameters

integer $n
string $className

Returns

mixed

getRowArray()

getRowArray(integer  $n) : mixed

Returns a single row from the results as an array.

If row doesn't exist, returns null.

Parameters

integer $n

Returns

mixed

getRowObject()

getRowObject(integer  $n) : mixed

Returns a single row from the results as an object.

If row doesn't exist, returns null.

Parameters

integer $n

Returns

mixed

setRow()

setRow(mixed  $key, mixed  $value = null) : mixed

Assigns an item into a particular column slot.

Parameters

mixed $key
mixed $value

Returns

mixed

getFirstRow()

getFirstRow(string  $type = 'object') : mixed

Returns the "first" row of the current results.

Parameters

string $type

Returns

mixed

getLastRow()

getLastRow(string  $type = 'object') : mixed

Returns the "last" row of the current results.

Parameters

string $type

Returns

mixed

getNextRow()

getNextRow(string  $type = 'object') : mixed

Returns the "next" row of the current results.

Parameters

string $type

Returns

mixed

getPreviousRow()

getPreviousRow(string  $type = 'object') : mixed

Returns the "previous" row of the current results.

Parameters

string $type

Returns

mixed

getUnbufferedRow()

getUnbufferedRow(string  $type = 'object') : mixed

Returns an unbuffered row and move the pointer to the next row.

Parameters

string $type

Returns

mixed

getFieldCount()

getFieldCount() : integer

Gets the number of fields in the result set.

Returns

integer

getFieldNames()

getFieldNames() : array

Generates an array of column names in the result set.

Returns

array

getFieldData()

getFieldData() : array

Generates an array of objects representing field meta-data.

Returns

array

freeResult()

freeResult() : void

Frees the current result.

dataSeek()

dataSeek(integer  $n) : mixed

Moves the internal pointer to the desired offset. This is called internally before fetching results to make sure the result set starts at zero.

Parameters

integer $n

Throws

\CodeIgniter\Database\Exceptions\DatabaseException

Returns

mixed

fetchAssoc()

fetchAssoc() : mixed

Returns the result set as an array.

Overridden by driver classes.

Returns

mixed

fetchObject()

fetchObject(string  $className = 'stdClass') : object|boolean

Returns the result set as an object.

Overridden by child classes.

Parameters

string $className

Returns

object|boolean