Documentation

Horde_Db_Adapter_Mysql_Result extends Horde_Db_Adapter_Base_Result
in package

This class represents the result set of a SELECT query from the MySQL driver.

Tags
author

Mike Naberezny mike@maintainable.com

author

Derek DeVries derek@maintainable.com

author

Chuck Hagenbuch chuck@horde.org

author

Jan Schneider jan@horde.org

category

Horde

copyright

2007 Maintainable Software, LLC

copyright

2006-2017 Horde LLC

license

http://www.horde.org/licenses/bsd

subpackage

Adapter

Table of Contents

$_adapter  : Horde_Db_Adapter
$_arg1  : mixed
$_arg2  : string
$_current  : array<string|int, mixed>
Current row.
$_eof  : bool
Are we at the end of the result?
$_fetchMode  : mixed
Which kind of keys to use for results.
$_index  : int
Current offset.
$_map  : array<string|int, mixed>
Maps Horde_Db fetch mode constant to the extension constants.
$_result  : resource
Result resource.
$_sql  : string
__construct()  : mixed
Constructor.
__destruct()  : mixed
Destructor.
columnCount()  : int
Returns the number of columns in the result set.
current()  : array<string|int, mixed>
Implementation of the current() method for Iterator.
fetch()  : mixed
Returns the current row and advances the recordset one row.
key()  : mixed
Implementation of the key() method for Iterator.
next()  : array<string|int, mixed>|null
Implementation of the next() method for Iterator.
rewind()  : mixed
Implementation of the rewind() method for iterator.
setFetchMode()  : mixed
Sets the default fetch mode for this result.
valid()  : bool
Implementation of the valid() method for Iterator.
_columnCount()  : int
Returns the number of columns in the result set.
_fetchArray()  : array<string|int, mixed>|bool
Returns a row from a resultset.

Properties

$_current

Current row.

protected array<string|int, mixed> $_current

$_eof

Are we at the end of the result?

protected bool $_eof

$_fetchMode

Which kind of keys to use for results.

protected mixed $_fetchMode = \Horde_Db::FETCH_ASSOC

$_index

Current offset.

protected int $_index

$_map

Maps Horde_Db fetch mode constant to the extension constants.

protected array<string|int, mixed> $_map = array(\Horde_Db::FETCH_ASSOC => \MYSQL_ASSOC, \Horde_Db::FETCH_NUM => \MYSQL_NUM, \Horde_Db::FETCH_BOTH => \MYSQL_BOTH)

$_result

Result resource.

protected resource $_result

Methods

__construct()

Constructor.

public __construct(Horde_Db_Adapter $adapter, string $sql[, mixed $arg1 = null ][, string $arg2 = null ]) : mixed
Parameters
$adapter : Horde_Db_Adapter

A driver instance.

$sql : string

A SQL query.

$arg1 : mixed = null

Either an array of bound parameters or a query name.

$arg2 : string = null

If $arg1 contains bound parameters, the query name.

Return values
mixed

__destruct()

Destructor.

public __destruct() : mixed
Return values
mixed

columnCount()

Returns the number of columns in the result set.

public columnCount() : int
Return values
int

Number of columns.

current()

Implementation of the current() method for Iterator.

public current() : array<string|int, mixed>
Return values
array<string|int, mixed>

The current row, or null if no rows.

fetch()

Returns the current row and advances the recordset one row.

public fetch([int $fetchmode = Horde_Db::FETCH_ASSOC ]) : mixed
Parameters
$fetchmode : int = Horde_Db::FETCH_ASSOC

The default fetch mode for this result. One of the Horde_Db::FETCH_* constants.

Return values
mixed

key()

Implementation of the key() method for Iterator.

public key() : mixed
Return values
mixed

The current row number (starts at 0), or null if no rows.

next()

Implementation of the next() method for Iterator.

public next() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

The next row in the resultset or null if there are no more results.

rewind()

Implementation of the rewind() method for iterator.

public rewind() : mixed
Return values
mixed

setFetchMode()

Sets the default fetch mode for this result.

public setFetchMode(int $fetchmode) : mixed
Parameters
$fetchmode : int

One of the Horde_Db::FETCH_* constants.

Return values
mixed

valid()

Implementation of the valid() method for Iterator.

public valid() : bool
Return values
bool

Whether the iteration is valid.

_columnCount()

Returns the number of columns in the result set.

protected _columnCount() : int
Return values
int

Number of columns.

_fetchArray()

Returns a row from a resultset.

protected _fetchArray() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool

The next row in the resultset or false if there are no more results.

Search results