MariaDBStatement
in package
implements
IDbStatement
Represents a MariaDB/MySQL prepared statement.
Table of Contents
Interfaces
- IDbStatement
- Represents a prepared database statement.
Methods
- __construct() : MariaDBStatement
- Creates a MariaDBStatement.
- __destruct() : mixed
- addParameter() : void
- Assigns a value to a parameter.
- close() : void
- execute() : void
- Executes this statement.
- getLastErrorCode() : int
- Gets the last error code.
- getLastErrors() : array<string|int, mixed>
- 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() : IDbResult
- Gets the result after execution.
- getSQLState() : string
- Gets the current SQL State of this statement.
- getWarnings() : array<string|int, mixed>
- Gets list of warnings.
- reset() : void
- Resets this statement for reuse.
Methods
__construct()
Creates a MariaDBStatement.
public
__construct(mysqli_stmt $statement) : MariaDBStatement
Parameters
- $statement : mysqli_stmt
-
Underlying statement object.
Return values
MariaDBStatement —A new statement instance.
__destruct()
public
__destruct() : mixed
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.
close()
public
close() : void
execute()
Executes this statement.
public
execute() : void
getLastErrorCode()
Gets the last error code.
public
getLastErrorCode() : int
Return values
int —Last error code.
getLastErrors()
Gets a list of errors from the last command.
public
getLastErrors() : array<string|int, mixed>
Return values
array<string|int, mixed> —List of last errors.
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.
getResult()
Gets the result after execution.
public
getResult() : IDbResult
Return values
IDbResult —Instance of an implementation of IDbResult.
getSQLState()
Gets the current SQL State of this statement.
public
getSQLState() : string
Return values
string —Current SQL State.
getWarnings()
Gets list of warnings.
public
getWarnings() : array<string|int, mixed>
The result of SHOW WARNINGS;
Return values
array<string|int, mixed> —List of warnings.
reset()
Resets this statement for reuse.
public
reset() : void