class MySQLQuery extends Query

A result-set from a MySQL database (using MySQLiConnector) Note that this class is only used for the results of non-prepared statements

Methods

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

from Query
array
keyedColumn()

Return an array containing all values in the leftmost column, where the keys are the same as the values.

from Query
array
map()

Return a map from the first column to the second column.

from Query
array
record()

Returns the first record in the result

from Query
array
first() deprecated

No description

from Query
string
value()

Returns the first column of the first record.

from Query
string
table()

Return an HTML table containing the full result-set

from Query
array
getIterator()

Return the next record in the query result.

int
numRecords()

Return the total number of items in the query result.

__construct(MySQLiConnector $database, mixed $handle)

Hook the result-set given into a Query class, suitable for use by SilverStripe.

__destruct()

No description

nextRecord()

No description

Details

in Query at line 40
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

Parameters

string $column

Return Value

array

in Query at line 61
array keyedColumn()

Return an array containing all values in the leftmost column, where the keys are the same as the values.

Return Value

array

in Query at line 77
array map()

Return a map from the first column to the second column.

Return Value

array

in Query at line 93
array record()

Returns the first record in the result

Return Value

array

in Query at line 102
array first() deprecated

deprecated Use record() instead

Return Value

array

in Query at line 112
string value()

Returns the first column of the first record.

Return Value

string

in Query at line 126
string table()

Return an HTML table containing the full result-set

Return Value

string

at line 48
array getIterator()

Return the next record in the query result.

Return Value

array

at line 57
int numRecords()

Return the total number of items in the query result.

Return Value

int

at line 33
__construct(MySQLiConnector $database, mixed $handle)

Hook the result-set given into a Query class, suitable for use by SilverStripe.

Parameters

MySQLiConnector $database The database object that created this query.
mixed $handle the internal mysql handle that is points to the resultset. Non-mysqli_result values could be given for non-select queries (e.g. true)

at line 41
__destruct()

at line 66
nextRecord()