DB_common::execute()

DB_common::execute() -- Executes a prepared SQL statment

Synopsis

Описание

Merges the SQL statment you submitted to prepare() with the information in $data and then sends the query to the database.

Параметр

resource $stmt

query handle from prepare()

mixed $data

array, string or numeric data to be added to the prepared statement. Quantity of items passed must match quantity of placeholders in the prepared statement: meaning 1 placeholder for non-array parameters or 1 placeholder per array element.

Возвращаемое значение

mixed - a new DB_result object for queries that return results (such as SELECT queries), DB_OK for queries that manipulate data (such as INSERT queries) or a DB_Error object on failure

Throws

Заметка

Эта функция не должна вызываться статически.

Внимание

The values passed in $data must be literals. Do not submit SQL functions (for example CURDATE()). SQL functions that should be performed at execution time need to be put in the prepared statement.

Пример

См. также

"Intro - Prepare & Execute", "Intro - autoPrepare & autoExecute", prepare(), executeMultiple()

    Поддержать сайт на родительском проекте КГБ