class SQLite3Result (View source)

A class that handles result sets for the SQLite 3 extension.

Methods

int
numColumns()

Returns the number of columns in the result set

string|false
columnName(int $column)

Returns the name of the nth column

int|false
columnType(int $column)

Returns the type of the nth column

array|false
fetchArray(int $mode = SQLITE3_BOTH)

Fetches a result row as an associative or numerically indexed array or both

bool
reset()

Resets the result set back to the first row

bool
finalize()

Closes the result set

Details

int numColumns()

Returns the number of columns in the result set

Return Value

int

the number of columns in the result set.

string|false columnName(int $column)

Returns the name of the nth column

Parameters

int $column

The numeric zero-based index of the column.

Return Value

string|false

the string name of the column identified by column_number.

int|false columnType(int $column)

Returns the type of the nth column

Parameters

int $column

The numeric zero-based index of the column.

Return Value

int|false

the data type index of the column identified by column_number (one of SQLITE3_INTEGER, SQLITE3_FLOAT, SQLITE3_TEXT, SQLITE3_BLOB, or SQLITE3_NULL).

array|false fetchArray(int $mode = SQLITE3_BOTH)

Fetches a result row as an associative or numerically indexed array or both

Parameters

int $mode

[optional]

Controls how the next row will be returned to the caller. This value must be one of either SQLITE3_ASSOC, SQLITE3_NUM, or SQLITE3_BOTH.

SQLITE3_ASSOC: returns an array indexed by column name as returned in the corresponding result set

Return Value

array|false

a result row as an associatively or numerically indexed array or both. Alternately will return FALSE if there are no more rows.

bool reset()

Resets the result set back to the first row

Return Value

bool

TRUE if the result set is successfully reset back to the first row, FALSE on failure.

bool finalize()

Closes the result set

Return Value

bool TRUE.