StatementInterface
Interface defining a query statement.
This interface is a partial standalone implementation of PDOStatement.
since |
2.0.0 |
---|---|
package |
Joomla Framework |
Methods
bindParam
Binds a parameter to the specified variable name.
bindParam(string|int parameter, mixed &variable, string dataType = ParameterType::STRING, int length = null, array driverOptions = null) : bool
since |
2.0.0 |
---|
Arguments
- parameter
string|int
Parameter identifier. For a prepared statement using named placeholders, this will be a parameter name of the form:name
. For a prepared statement using question mark placeholders, this will be the 1-indexed position of the parameter.- variable
mixed
Name of the PHP variable to bind to the SQL statement parameter.- dataType
string
Constant corresponding to a SQL datatype, this should be the processed type from the QueryInterface.- length
int
The length of the variable. Usually required for OUTPUT parameters.- driverOptions
array
Optional driver options to be used.
Response
bool
closeCursor
Closes the cursor, enabling the statement to be executed again.
closeCursor() : void
since |
2.0.0 |
---|
errorCode
Fetches the SQLSTATE associated with the last operation on the statement handle.
errorCode() : string
since |
2.0.0 |
---|
Response
string
errorInfo
Fetches extended error information associated with the last operation on the statement handle.
errorInfo() : array
since |
2.0.0 |
---|
Response
array
execute
Executes a prepared statement
execute(array|null parameters = null) : bool
since |
2.0.0 |
---|
Arguments
- parameters
array|null
An array of values with as many elements as there are bound parameters in the SQL statement being executed.
Response
bool
fetch
Fetches the next row from a result set
fetch(int|null fetchStyle = null, int cursorOrientation = FetchOrientation::NEXT, int cursorOffset) : mixed
since |
2.0.0 |
---|
Arguments
- fetchStyle
int|null
Controls how the next row will be returned to the caller. This value must be one of the FetchMode constants, defaulting to value of FetchMode::MIXED.- cursorOrientation
int
For a StatementInterface object representing a scrollable cursor, this value determines which row will be returned to the caller. This value must be one of the FetchOrientation constants, defaulting to FetchOrientation::NEXT.- cursorOffset
int
For a StatementInterface object representing a scrollable cursor for which the cursorOrientation parameter is set to FetchOrientation::ABS, this value specifies the absolute number of the row in the result set that shall be fetched. For a StatementInterface object representing a scrollable cursor for which the cursorOrientation parameter is set to FetchOrientation::REL, this value specifies the row to fetch relative to the cursor position beforefetch()
was called.
Response
mixed
The return value of this function on success depends on the fetch type. In all cases, boolean false is returned on failure.
rowCount
Returns the number of rows affected by the last SQL statement.
rowCount() : int
since |
2.0.0 |
---|
Response
int
setFetchMode
Sets the fetch mode to use while iterating this statement.
setFetchMode(int fetchMode, mixed args) : void
since |
2.0.0 |
---|
Arguments
- fetchMode
int
The fetch mode, must be one of the FetchMode constants.- args
mixed
Optional mode-specific arguments.