CodeIgniter v4.7 API

PreparedQuery extends BasePreparedQuery
in package

Prepared query for SQLSRV

Tags
extends

Table of Contents

Properties

$db  : TDb
A reference to the db connection to use.
$errorCode  : int
The error code, if any.
$errorString  : string
The error message, if any.
$parameters  : array<int, mixed>
Parameters array used to store the dynamic variables.
$query  : Query
Holds the prepared query object that is cloned during execute.
$statement  : TStatement|null
The prepared statement itself.

Methods

__construct()  : mixed
_execute()  : bool
_getResult()  : resource|null
Returns the result object for the prepared query.
_prepare()  : $this
close()  : bool
Explicitly closes the statement.
execute()  : bool|ResultInterface<TConnection, TResult>
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
isBinary()  : bool
Whether the input contain binary data.
parameterize()  : array<int, mixed>
Handle parameters.

Properties

$parameters

Parameters array used to store the dynamic variables.

protected array<int, mixed> $parameters = []

$statement

The prepared statement itself.

protected TStatement|null $statement

Methods

_execute()

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.

public _getResult() : resource|null
Return values
resource|null

_prepare()

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

Positional array of bind values, keyed by placeholder index.

Tags
throws
DatabaseException
Return values
$this

close()

Explicitly closes the statement.

public close() : bool
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<TConnection, TResult>
Parameters
$data : mixed
Tags
throws
DatabaseException
Return values
bool|ResultInterface<TConnection, TResult>

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

isBinary()

Whether the input contain binary data.

protected isBinary(string $input) : bool
Parameters
$input : string
Return values
bool

parameterize()

Handle parameters.

protected parameterize(string $queryString, array<string|int, mixed> $options) : array<int, mixed>
Parameters
$queryString : string
$options : array<string|int, mixed>
Return values
array<int, mixed>
On this page

Search results