MySqliResult

MySQL query result class. Get an IDbResult instance from the IDbAbstract object using the getResult() method to be able to query database while walking through a previously queries results using the same IDbAbstract object.
Source
MySqliResult.php
Implements
IDbResult , Iterator

Methods

__construct

MySqliResult $obj = new MySqliResult(resource res)

Create an IDbResult instance.

Arguments

    res (resource)
    Database query result.

Returns

void

__get

mixed __get(string col)

Get data of a column. You can get the data immediately after a query, if no row has been fetched yet, this will fetch a row to get the column data.

Arguments

    col (string)
    Column name

Returns

mixed
Data

count

int $obj->count()

Get row count.

Returns

int
Row count

current

string $obj->current()

Iterator - current.

Returns

string
Current header item

fieldCount

int $obj->fieldCount()

Query field count.

Returns

int
Field count

fields

array|string $obj->fields(string glue=null, string esc="`")

Get query columns.

Arguments

    glue=null (string)
    null=return an array of column names, string=return a string of column names glued with the string
    esc="`" (string)
    Column name escape character

Returns

array|string
A list of column names or a string of glued column names

free

void $obj->free()

Free query result resource.

Returns

void

key

int $obj->key()

Iterator - key.

Returns

int
Row number

next

object|array $obj->next()

Fetch row as object (default) or array.

Returns

object|array
The fetched row

rewind

void $obj->rewind()

Iterator - rewind.

Returns

void

row

array $obj->row()

Fetch row as array.

Returns

array
The fetched row.

seek

void $obj->seek(int row=0)

Move to a row.

Arguments

    row=0 (int)
    Zero based row index

Returns

void

valid

bool $obj->valid()

Iterator - valid.

Returns

bool
true=is valid