CodeIgniter v4.5 API

PreparedQuery extends BasePreparedQuery
in package

Prepared query for SQLite3

Tags
extends

BasePreparedQuery<SQLite3, SQLite3Stmt, SQLite3Result>

Table of Contents

Properties

$db  : BaseConnection
A reference to the db connection to use.
$errorCode  : int
The error code, if any.
$errorString  : string
The error message, if any.
$query  : Query
Holds the prepared query object that is cloned during execute.
$result  : false|SQLite3Result
The SQLite3Result resource, or false.
$statement  : object|resource|null
The prepared statement itself.

Methods

__construct()  : mixed
_execute()  : bool
Takes a new set of data and runs it against the currently prepared query. Upon success, will return a Results object.
_getResult()  : false|SQLite3Result
Returns the result object for the prepared query or false on failure.
_prepare()  : $this
Prepares the query against the database, and saves the connection info necessary to execute the query later.
close()  : bool
Explicitly closes the prepared statement.
execute()  : bool|ResultInterface
Takes a new set of data and runs it against the currently prepared query. Upon success, will return a Results object.
getErrorCode()  : int
Returns the error code created while executing this statement.
getErrorMessage()  : string
Returns the error message created while executing this statement.
getQueryString()  : string
Returns the SQL that has been prepared.
hasError()  : bool
A helper to determine if any error exists.
prepare()  : $this
Prepares the query against the database, and saves the connection info necessary to execute the query later.
_close()  : bool
Deallocate prepared statements.

Properties

$result

The SQLite3Result resource, or false.

protected false|SQLite3Result $result

$statement

The prepared statement itself.

protected object|resource|null $statement
Tags
phpstan-var

TStatement|null

Methods

_execute()

Takes a new set of data and runs it against the currently prepared query. Upon success, will return a Results object.

public _execute(array<string|int, mixed> $data) : bool
Parameters
$data : array<string|int, mixed>
Return values
bool

_getResult()

Returns the result object for the prepared query or false on failure.

public _getResult() : false|SQLite3Result
Return values
false|SQLite3Result

_prepare()

Prepares the query against the database, and saves the connection info necessary to execute the query later.

public _prepare(string $sql[, array<string|int, mixed> $options = [] ]) : $this

NOTE: This version is based on SQL code. Child classes should override this method.

Parameters
$sql : string
$options : array<string|int, mixed> = []

Passed to the connection's prepare statement. Unused in the MySQLi driver.

Return values
$this

close()

Explicitly closes the prepared statement.

public close() : bool
Tags
throws
BadMethodCallException
Return values
bool

execute()

Takes a new set of data and runs it against the currently prepared query. Upon success, will return a Results object.

public execute(mixed ...$data) : bool|ResultInterface
Parameters
$data : mixed
Tags
phpstan-return

bool|ResultInterface<TConnection, TResult>

throws
DatabaseException
Return values
bool|ResultInterface

getErrorCode()

Returns the error code created while executing this statement.

public getErrorCode() : int
Return values
int

getErrorMessage()

Returns the error message created while executing this statement.

public getErrorMessage() : string
Return values
string

getQueryString()

Returns the SQL that has been prepared.

public getQueryString() : string
Return values
string

hasError()

A helper to determine if any error exists.

public hasError() : bool
Return values
bool

prepare()

Prepares the query against the database, and saves the connection info necessary to execute the query later.

public prepare(string $sql[, array<string|int, mixed> $options = [] ][, string $queryClass = Query::class ]) : $this

NOTE: This version is based on SQL code. Child classes should override this method.

Parameters
$sql : string
$options : array<string|int, mixed> = []
$queryClass : string = Query::class
Return values
$this

_close()

Deallocate prepared statements.

protected _close() : bool
Return values
bool

        
On this page

Search results