Class representing database result sets.
Class representing database result sets.
Several methods are available to fetch the actual data from the database.
query_type() ¶Find out the type of the query for this ResultSet instance.
The type of the query. These are constants like ANEWT_DATABASE_SQL_QUERY_TYPE_SELECT and ANEWT_DATABASE_SQL_QUERY_TYPE_INSERT.
free() ¶Free resources associated with this result set.
You cannot use any methods on the result set instance anymore after calling this method.
This method should be overridden using backend-specific code.
fetch() ¶Returns the next row in this result set.
An associative array containing all fields of the next result row from the result set.
fetch_all() ¶Returns all remaining rows from the current resultset.
A numeric array containing the result rows as associative array (may be an empty list).
fetch_many($num=1) ¶Returns the specified number of rows from the current resultset.
Note that the actual number of rows may be lower than the value specified, since there may be less rows in the set.
$numThe number of rows to return (optional, defaults to 1).
A numeric array containing the result rows as associative array (the list may contain less than $num rows, or may even be empty).
count() ¶Returns the number of resulting rows in this resultset.
This method might not be available for some databases (it works at least with MySQL and PostgreSQL though).
The total number of result rows.
count_affected() ¶Returns the number of rows that where affected by the last executed query.
This method might nog be available for some databases (it works at least with MySQL and PostgreSQL though).
deduce_types() [private] ¶Deduces the data types in this result set.
This method can be implemented in backends to do automatic type conversion.