auDBResult
The auDBResult class is part of the auLib package. It encapsulates the results of a database query and gets returned by auDB functions Get()
, GetLimit()
, and GetSplit()
.
Usage
auDBResult objects are not meant to be created manually -- one of the auDB functions should be used instead. When an auDBResult object is returned by an auDB function, record can be accessed using NextRecord()
, or other functions may be useful.
Public Functions
new auDBResult
new auDBResult($query)
Runs an SQL query against the database and provides access to the results. Note: This should not be used except by the auDB class.
- $query = SQL query to run.
IsError
IsError()
Returns whether the query resulted in an error.
- @return = True if the query resulted in an error.
GetMessage
GetMessage()
Returns the error message returned by the query.
- @return = Error message returned by the query, or an empty string if the query did not result in an error.
NumRecords
NumRecords()
Returns the number of records affected or returned by the query.
- @return = Number of records affected or returned by the query.
NextRecord
NextRecord($object)
Returns the next record returned by the query.
- $object = Set to false to return the record as an array. Default is to return the record as an object.
- @return = The next record returned by the query, or false if no more records.