Index Documentation

IDbStatement extends ICloseable
in

Represents a prepared database statement.

Table of Contents

Methods

addParameter()  : void
Assigns a value to a parameter.
close()  : void
Free, release or reset unmanaged resources.
execute()  : int|string
Executes this statement.
getLastInsertId()  : int|string
Returns the ID of the last inserted row.
getParameterCount()  : int
Returns how many parameters there are.
getResult()  : IDbResult
Gets the result after execution.
nextParameter()  : void
Assigns a value to the next parameter.
reset()  : void
Resets this statement for reuse.

Methods

addParameter()

Assigns a value to a parameter.

public addParameter(int $ordinal, mixed $value[, int $type = DbType::AUTO ]) : void
Parameters
$ordinal : int

Index of the target parameter.

$value : mixed

Value to assign to the parameter.

$type : int = DbType::AUTO

Type of the value, if left to DbType::AUTO DbTools::detectType will be used on $value.

Tags
throws
InvalidArgumentException

If $ordinal exceeds bounds.

close()

Free, release or reset unmanaged resources.

public close() : void

execute()

Executes this statement.

public execute() : int|string
Return values
int|string

Number of rows affected by the query.

getLastInsertId()

Returns the ID of the last inserted row.

public getLastInsertId() : int|string
Return values
int|string

Last inserted ID.

getParameterCount()

Returns how many parameters there are.

public getParameterCount() : int
Return values
int

Number of parameters.

getResult()

Gets the result after execution.

public getResult() : IDbResult
Return values
IDbResult

Instance of an implementation of IDbResult.

nextParameter()

Assigns a value to the next parameter.

public nextParameter(mixed $value[, int $type = DbType::AUTO ]) : void

Behaviour of this method may be slightly undefined if addParameter is used at the same time. Overwriting lower ordinals than the current cursor should be fine, but your mileage may vary.

Parameters
$value : mixed

Value to assign to the parameter.

$type : int = DbType::AUTO

Type of the value, if left to DbType::AUTO DbTools::detectType will be used on $value.

Tags
throws
RuntimeException

If all parameters have already been specified.

reset()

Resets this statement for reuse.

public reset() : void

        
On this page

Search results