DB_common::execute()

DB_common::execute()

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

Description

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

Parameter

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.

Return value

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

Note

This function can not be called statically.

Warning

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.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.