Editor PHP 2.0.5

Result

Result object given by a {@see Query} performed on a database.

The typical pattern for using this class is to receive an instance of it as a result of using the Database and Query class methods that return a result. This class should not be initialised independently.

Note that this is a stub class that a driver will extend and complete as required for individual database types. Individual drivers could add additional methods, but this is discouraged to ensure that the API is the same for all database types.

Table of Contents

count()  : mixed
Count the number of rows in the result set.
fetch()  : array<string|int, mixed>
Get the next row in a result set
fetchAll()  : array<string|int, mixed>
Get all rows in the result set
insertId()  : mixed
After an INSERT query, get the ID that was inserted.

Methods

count()

Count the number of rows in the result set.

public count() : mixed

@return int

Return values
mixed

fetch()

Get the next row in a result set

public fetch([mixed $fetchType = PDO::FETCH_ASSOC ]) : array<string|int, mixed>

@param int PDO row fetch style - PDO::FETCH_ASSOC is the default

Parameters
$fetchType : mixed = PDO::FETCH_ASSOC
Return values
array<string|int, mixed>

fetchAll()

Get all rows in the result set

public fetchAll([mixed $fetchType = PDO::FETCH_ASSOC ]) : array<string|int, mixed>

@param int PDO row fetch style - PDO::FETCH_ASSOC is the default

Parameters
$fetchType : mixed = PDO::FETCH_ASSOC
Return values
array<string|int, mixed>

insertId()

After an INSERT query, get the ID that was inserted.

public insertId() : mixed

@return int

Return values
mixed

Search results