v5:reference:connection:execute
This is an old revision of the document!
Execute
syntax
mixed execute { mixed $sql optional string[] $bindvars }
Description
The function executes a statement and returns a handle to a recordset or false if the statement execution fails
Parameters
Parameter 1
The first parameter can be either:
- A string containing a complete SQL statement.
SELECT * FROM ACT
- A string containing an SQL statement with bind variables,
SELECT * FROM ACT WHERE empno>:emp
, in which case the second parameter is an array containing the bind variables - A array of SQL Statements. This is only available to internal functions.
Parameter 2
If set, contains an array of bind variables.
Usage
$db->execute("SELECT * FROM ACT"); $db->execute("SELECT * FROM ACT WHERE empno > :emp", array('emp'=>1234) );
v5/reference/connection/execute.1437245964.txt.gz · Last modified: 2017/04/21 11:35 (external edit)