DB_common::execute()

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

Opis

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

Parametr

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.

Zwracana wartość

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

Uwagi

Ta funkcja nie może być wywołana statycznie.

Ostrzeżenie

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.