AnewtDatabasePreparedQuery class

Prepared query class.

Class Overview

Prepared query class.

This class represents a database query (optionally with placeholders) that has not been executed yet.

To obtain an AnewtDatabasePreparedQuery instance, use AnewtDatabaseConnection::prepare(). In many cases the other query methods in AnewtDatabaseConnection suffice, so it is not likely you will be dealing with prepared queries directly.

To execute the prepared query, use either AnewtDatabasePreparedQuery::execute() or AnewtDatabasePreparedQuery::executev(), depending on how you want to pass the parameters to be filled in in the query template. See AnewtDatabaseSQLTemplate for more information.

Public Methods

execute($values=null)

Execute the query using the values passed as multiple parameters.

Parameters

$values

Zero or more values to be substituted for the placeholders.

Return value

An AnewtDatabaseResultSet instance.

See also

executev($values=null)

Execute the query using the values passed as a single parameter.

Parameters

$values

An array of values to be substituted for the placeholders.

Return value

An AnewtDatabaseResultSet instance.

See also

Private Methods

__construct($sql, $connection) [private]

Construct a new AnewtDatabasePreparedQuery.

Don't use this method directly: use $connection->prepare() instead.

Parameters

$sql

SQL query template with ?int? style placeholders.

$connection

An AnewtDatabaseConnection instance

See also

Private Attributes

$connection [private]

The associated AnewtDatabaseConnection.

$sql_template [private]

The associated AnewtDatabaseSQLTemplate.