interface ResultStatement implements Traversable (View source)

Interface for the reading part of a prepare statement only.

Methods

boolean
closeCursor()

Closes the cursor, enabling the statement to be executed again.

integer
columnCount()

columnCount Returns the number of columns in the result set

setFetchMode($fetchStyle, $arg2 = null, $arg3 = null)

setFetchMode Set the fetch mode to use while iterating this statement.

mixed
fetch($fetchStyle = PDO::FETCH_BOTH)

fetch

array
fetchAll($fetchStyle = PDO::FETCH_BOTH)

Returns an array containing all of the result set rows

string
fetchColumn(integer $columnIndex = 0)

fetchColumn Returns a single column from the next row of a result set or FALSE if there are no more rows.

Details

boolean closeCursor()

Closes the cursor, enabling the statement to be executed again.

Return Value

boolean Returns TRUE on success or FALSE on failure.

integer columnCount()

columnCount Returns the number of columns in the result set

Return Value

integer Returns the number of columns in the result set represented by the PDOStatement object. If there is no result set, this method should return 0.

setFetchMode($fetchStyle, $arg2 = null, $arg3 = null)

setFetchMode Set the fetch mode to use while iterating this statement.

Parameters

$fetchStyle
$arg2
$arg3

mixed fetch($fetchStyle = PDO::FETCH_BOTH)

fetch

Parameters

$fetchStyle

Return Value

mixed

See also

Query::HYDRATE_* constants

array fetchAll($fetchStyle = PDO::FETCH_BOTH)

Returns an array containing all of the result set rows

Parameters

$fetchStyle

Return Value

array

string fetchColumn(integer $columnIndex = 0)

fetchColumn Returns a single column from the next row of a result set or FALSE if there are no more rows.

Parameters

integer $columnIndex 0-indexed number of the column you wish to retrieve from the row. If no value is supplied, PDOStatement->fetchColumn() fetches the first column.

Return Value

string returns a single column in the next row of a result set.