Database result set.
Database result set.
Result sets can be used to fetch or count rows returned by a database query.
You cannot instantiate AnewtDatabaseResultSet instances directly, instances of this class will be returned when an AnewtDatabasePreparedQuery is executed using AnewtDatabasePreparedQuery::prepare().
__construct($sql, $connection_handle, $result_set_handle) ¶Construct a new AnewtDatabaseResultSet instance (internal use).
Do not call this method directly; it is for internal use only.
(Note to backend implementors: you should override this constructor, call into the parent, and then store the n_rows and n_rows_affected values)
$sqlThe SQL query for this result set
$connection_handleThe internal connection handle
$result_set_handleThe internal result set handle
free() ¶Free resources associated with this result set.
You cannot use any methods on the result set instance anymore after calling this method.
fetch_one() ¶Return the next row.
An associative array containing all fields of the next result row from the result set.
fetch_all() ¶Return all remaining rows.
A numeric array containing the result rows as associative arrays. This may be an empty list.
AnewtDatabaseResultSet::fetch_many fetch_many($how_many) ¶Return up to the specified number of rows.
The actual number of rows may be lower than the value specified, since there may be less rows in the set.
$how_manyThe number of rows to return. This must be a positive integer value.
A numeric array containing the result rows as associative arrays. This may be an empty list.
AnewtDatabaseResultSet::fetch_all count() ¶Return the number of resulting rows in this result set.
The total number of result rows.
count_affected() ¶Returns the number of rows that where affected by the last executed query.
The total number of affected rows.
obtain_field_types() [protected] ¶Deduce the data types in this result set.
This method should be implemented in backends to perform automatic type conversion.
cast_row(&$row) [protected] ¶Cast a row of data into native PHP data types.
This method should be implemented in backends to perform automatic type conversion.
Note that the array is modified in-place (and no result is returned).
$rowA row of data.
$connection_handle [protected] ¶The underlying database connection resource.
$result_set_handle [protected] ¶The underlying database result set resource.
$n_rows_affected [protected] ¶The number of affected rows.
$field_types [protected] ¶The data types for the columns of this result set.