Class PreparedQuery

Summary

Fully Qualified Name: CodeIgniter\Database\MySQLi\PreparedQuery
Extends: BasePreparedQuery
Implements: PreparedQueryInterface

Description

Prepared query for MySQLi

Methods

Name Description Defined By
__construct() Constructor. BasePreparedQuery
_execute() Takes a new set of data and runs it against the currently prepared query. Upon success, will return a Results object. PreparedQuery
_getResult() Returns the result object for the prepared query. PreparedQuery
_prepare() Prepares the query against the database, and saves the connection info necessary to execute the query later. PreparedQuery
close() Explicitly closes the statement. BasePreparedQuery
execute() Takes a new set of data and runs it against the currently prepared query. Upon success, will return a Results object. BasePreparedQuery
getErrorCode() Returns the error code created while executing this statement. BasePreparedQuery
getErrorMessage() Returns the error message created while executing this statement. BasePreparedQuery
getQueryString() Returns the SQL that has been prepared. BasePreparedQuery
hasError() A helper to determine if any error exists. BasePreparedQuery
prepare() Prepares the query against the database, and saves the connection info necessary to execute the query later. BasePreparedQuery

Method Details

__construct()

Constructor.

Parameter Name Type Description
$db \CodeIgniter\Database\ConnectionInterface

Returns:

_execute()

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

Parameter Name Type Description
$data array

Returns: bool

_getResult()

Returns the result object for the prepared query.

Returns: mixed

_prepare()

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

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

Parameter Name Type Description
$sql string
$options array Passed

Returns: mixed

close()

Explicitly closes the statement.

Returns: null|void

execute()

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

Parameter Name Type Description
$data array

Returns: \ResultInterface

getErrorCode()

Returns the error code created while executing this statement.

Returns: int

getErrorMessage()

Returns the error message created while executing this statement.

Returns: string

getQueryString()

Returns the SQL that has been prepared.

Returns: string

hasError()

A helper to determine if any error exists.

Returns: bool

prepare()

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

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

Parameter Name Type Description
$sql string
$options array Passed
$queryClass string

Returns: mixed

Top