Index Documentation

MariaDbStatement
in package
implements DbStatement

Represents a MariaDB/MySQL prepared statement.

Table of Contents

Interfaces

DbStatement
Represents a prepared database statement.

Methods

__construct()  : MariaDbStatement
Creates a MariaDbStatement.
__destruct()  : mixed
addParameter()  : void
Assigns a value to a parameter.
construct()  : void
Determines which MariaDbResult implementation should be used.
execute()  : int|string
Executes this statement.
getLastErrorCode()  : int
Gets the last error code.
getLastErrors()  : array<string|int, MariaDbWarning>
Gets a list of errors from the last command.
getLastErrorString()  : string
Gets the last error string.
getLastInsertId()  : int|string
Returns the ID of the last inserted row.
getParameterCount()  : int
Returns how many parameters there are.
getResult()  : DbResult
Gets the result after execution.
getSQLState()  : string
Gets the current SQL State of this statement.
getWarnings()  : array<string|int, MariaDbWarning>
Gets list of warnings.
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 DbType::detect will be used on $value.

construct()

Determines which MariaDbResult implementation should be used.

public static construct() : void

execute()

Executes this statement.

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

Number of rows affected by the query.

getLastErrorCode()

Gets the last error code.

public getLastErrorCode() : int
Return values
int

Last error code.

getLastErrorString()

Gets the last error string.

public getLastErrorString() : string
Return values
string

Last error string.

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.

getSQLState()

Gets the current SQL State of this statement.

public getSQLState() : string
Return values
string

Current SQL State.

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 DbType::detect will be used on $value.


        
On this page

Search results