SQLiteStatement
in package
implements
IDbStatement
Represents a prepared SQLite SQL statement.
Table of Contents
Interfaces
- IDbStatement
- Represents a prepared database statement.
Methods
- __construct() : SQLiteStatement
- Creates a new SQLiteStatement instance.
- addParameter() : void
- Assigns a value to a parameter.
- close() : void
- execute() : void
- 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.
- reset() : void
- Resets this statement for reuse.
Methods
__construct()
Creates a new SQLiteStatement instance.
public
__construct(SQLiteConnection $connection, SQLite3Stmt $statement) : SQLiteStatement
Parameters
- $connection : SQLiteConnection
-
A reference to the connection which creates this statement.
- $statement : SQLite3Stmt
-
The raw statement instance.
Return values
SQLiteStatement —A new statement instance.
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
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.
reset()
Resets this statement for reuse.
public
reset() : void