Public Member Functions | |
| __construct ($sql, $connection_handle, $result_set_handle) | |
| Construct a new AnewtDatabaseResultSet instance (internal use). | |
| free () | |
| Free resources associated with this result set. | |
Row Fetching Methods | |
| fetch_one () | |
| Return the next row. | |
| fetch_all () | |
| Return all remaining rows. | |
| fetch_many ($how_many) | |
| Return up to the specified number of rows. | |
Row Counting Methods | |
| count () | |
| Return the number of resulting rows in this result set. | |
| count_affected () | |
| Returns the number of rows that where affected by the last executed query. | |
Protected Member Functions | |
Helper Methods | |
| obtain_field_types () | |
| Deduce the data types in this result set. | |
| cast_row (&$row) | |
| Cast a row of data into native PHP data types. | |
Protected Attributes | |
| $sql | |
| The SQL query for this result set. | |
| $connection_handle | |
| The underlying database connection resource. | |
| $result_set_handle | |
| The underlying database result set resource. | |
| $n_rows | |
| The number of rows. | |
| $n_rows_affected | |
| The number of affected rows. | |
| $field_types | |
| The data types for the columns of this 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().
Definition at line 20 of file result-set.lib.php.
| AnewtDatabaseResultSet::__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)
| $sql | The SQL query for this result set | |
| $connection_handle | The internal connection handle | |
| $result_set_handle | The internal result set handle |
Reimplemented in AnewtDatabaseResultSetMySQLOld, AnewtDatabaseResultSetMySQL, AnewtDatabaseResultSetPostgreSQL, and AnewtDatabaseResultSetSQLite.
Definition at line 69 of file result-set.lib.php.
| AnewtDatabaseResultSet::free | ( | ) | [abstract] |
Free resources associated with this result set.
You cannot use any methods on the result set instance anymore after calling this method.
Reimplemented in AnewtDatabaseResultSetMySQLOld, AnewtDatabaseResultSetMySQL, AnewtDatabaseResultSetPostgreSQL, and AnewtDatabaseResultSetSQLite.
| AnewtDatabaseResultSet::fetch_one | ( | ) | [abstract] |
Return the next row.
Reimplemented in AnewtDatabaseResultSetMySQLOld, AnewtDatabaseResultSetMySQL, AnewtDatabaseResultSetPostgreSQL, and AnewtDatabaseResultSetSQLite.
| AnewtDatabaseResultSet::fetch_all | ( | ) |
Return all remaining rows.
Reimplemented in AnewtDatabaseResultSetSQLite.
Definition at line 113 of file result-set.lib.php.
| AnewtDatabaseResultSet::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_many | The number of rows to return. This must be a positive integer value. |
Definition at line 146 of file result-set.lib.php.
| AnewtDatabaseResultSet::count | ( | ) |
Return the number of resulting rows in this result set.
Definition at line 176 of file result-set.lib.php.
| AnewtDatabaseResultSet::count_affected | ( | ) |
Returns the number of rows that where affected by the last executed query.
Definition at line 187 of file result-set.lib.php.
| AnewtDatabaseResultSet::obtain_field_types | ( | ) | [abstract, protected] |
Deduce the data types in this result set.
This method should be implemented in backends to perform automatic type conversion.
Reimplemented in AnewtDatabaseResultSetMySQLOld, AnewtDatabaseResultSetMySQL, AnewtDatabaseResultSetPostgreSQL, and AnewtDatabaseResultSetSQLite.
| AnewtDatabaseResultSet::cast_row | ( | &$ | row | ) | [abstract, 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).
| $row | A row of data. |
Reimplemented in AnewtDatabaseResultSetMySQLOld, AnewtDatabaseResultSetMySQL, AnewtDatabaseResultSetPostgreSQL, and AnewtDatabaseResultSetSQLite.
1.5.9