libasynql
3.2.0
Asynchronous MySQL access library for PocketMine plugins.
|
Public Member Functions | |
__construct (array $columnInfo, array $rows) | |
getColumnInfo () | |
getRows () | |
Definition at line 27 of file SqlSelectResult.php.
__construct | ( | array | $columnInfo, |
array | $rows | ||
) |
SqlSelectResult constructor.
SqlColumnInfo[] | $columnInfo |
array[] | $rows |
Definition at line 37 of file SqlSelectResult.php.
getColumnInfo | ( | ) |
Returns the columns from the query
Definition at line 47 of file SqlSelectResult.php.
getRows | ( | ) |
Returns an array of rows. Each row is an array with keys as the (virtual) column name and values as the cell value. The type of cell values are juggled with the following special rules:
TINYINT(1)
and BIT(1)
in MySQL are expressed in bool
long long
, a.k.a. BIGINT [SIGNED]
, i.e. 64-bit unsigned integers, are expressed in int
, because PocketMine only supports 64-bit machines.long long
, a.k.a. BIGINT [SIGNED]
, i.e. 64-bit unsigned integers, are also expressed in int
. If it exceeds PHP_INT_MAX
, it overflows natively, i.e. PHP_INT_MAX + 1 becomes PHP_INT_MIN, which is different from both mysqli's implementation and PHP's behaviour.If the query has multiple columns with the same name, the latter one overwrites the former ones. For example, the query SELECT 1 a, 2 a
returns the result set [ ["a" => 2] ]
.
Also note that qualifying the column reference with the table name will not add the table name into the column name in the result set. For example, the query SELECT foo.qux, bar.qux
will return the result set [ ["qux" => "the value in bar.qux"] ]
.
Therefore, use column aliases when the column names may duplicate.
Definition at line 67 of file SqlSelectResult.php.