MySQLQuery
class MySQLQuery extends Query (View source)
A result-set from a MySQL database (using MySQLiConnector) Note that this class is only used for the results of non-prepared statements
Properties
protected deprecated | array | $currentRecord | The current record in the iterator. |
from Query |
protected deprecated | int | $rowNum | The number of the current row in the iterator. |
from Query |
protected deprecated | bool | $queryHasBegun | Flag to keep track of whether iteration has begun, to prevent unnecessary seeks |
from Query |
protected | mixed | $handle | The internal MySQL handle that points to the result set. |
|
protected | $columns | Metadata about the columns of this query |
Methods
Return an array containing all the values from a specific column. If no column is set, then the first will be returned
Return an array containing all values in the leftmost column, where the keys are the same as the values.
Iterator function implementation. Rewind the iterator to the first item and return it.
Iterator function implementation. Check if the iterator is pointing to a valid item.
Hook the result-set given into a Query class, suitable for use by SilverStripe.
Details
in
Query at line 65
array
column(string $column = null)
Return an array containing all the values from a specific column. If no column is set, then the first will be returned
in
Query at line 86
array
keyedColumn()
Return an array containing all values in the leftmost column, where the keys are the same as the values.
in
Query at line 101
array
map()
Return a map from the first column to the second column.
in
Query at line 117
array
record()
Returns the next record in the iterator.
in
Query at line 127
string
value()
Returns the first column of the first record.
in
Query at line 141
string
table()
Return an HTML table containing the full result-set
in
Query at line 178
void
rewind()
deprecated
deprecated
Iterator function implementation. Rewind the iterator to the first item and return it.
Makes use of seek()} and {@link numRecords(), takes care of the plumbing.
in
Query at line 197
array
current()
deprecated
deprecated
Iterator function implementation. Return the current item of the iterator.
in
Query at line 216
array
first()
deprecated
deprecated
Iterator function implementation. Return the first item of this iterator.
in
Query at line 231
int
key()
deprecated
deprecated
Iterator function implementation. Return the row number of the current item.
in
Query at line 247
array
next()
deprecated
deprecated
Iterator function implementation. Return the next record in the iterator.
Makes use of nextRecord(), takes care of the plumbing.
in
Query at line 265
bool
valid()
deprecated
deprecated
Iterator function implementation. Check if the iterator is pointing to a valid item.
array
nextRecord()
deprecated
deprecated
No description
int
numRecords()
Return the total number of items in the query result.
array
seek($row)
deprecated
deprecated
No description
__construct(MySQLiConnector $database, mixed $handle)
Hook the result-set given into a Query class, suitable for use by SilverStripe.
__destruct()
No description