ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:execute

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
reference:execute [2015/07/21 16:21] – [Description] mnewnhamv5:reference:connection:execute [2022/10/29 00:33] – [Parameter 1] removed "array of sql statements" following discussion in #872 dregad
Line 1: Line 1:
-====== Execute ======+====== execute ======
 ~~NOTOC~~ ~~NOTOC~~
 <WRAP right box> <WRAP right box>
Line 10: Line 10:
  
 ===== Description ===== ===== Description =====
-The function executes statement and returns a handle to a recordset or false if the statement execution fails. The presentation of the returned data can be modified by the variables [[reference:adodb_fetch_mode|$ADODB_FETCH_MODE]]  and [[reference:adodb_assoc_case|$ADODB_ASSOC_CASE]] and the function [[,eference:setfetchmode|setFetchMode()]].+This method executes any provided SQL statement. If the SQL statement should return a recordset, e.g. ''SELECT'' statements, it returns a handle to a recordset or false if the statement execution fails. If the statement does not return a recordset, such as in ''INSERT'' or ''UPDATE'' statement, it returns true on success or false on failure.  
 + 
 + 
 +The presentation of the returned data can be modified by the [[v5:reference:adodb_fetch_mode|$ADODB_FETCH_MODE]] variable, the [[v5:reference:adodb_assoc_case|ADODB_ASSOC_CASE]] constant and the [[v5:reference:connection:setfetchmode|setFetchMode()]] function.
 ===== Parameters ===== ===== Parameters =====
 ==== Parameter 1 ==== ==== Parameter 1 ====
Line 16: Line 19:
  
   - A string containing a complete SQL statement. ''SELECT * FROM ACT''   - 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 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 ==== ==== Parameter 2 ====
 If set, contains an array of bind variables. If set, contains an array of bind variables.
  
 ==== Result ===== ==== Result =====
-If the execution succeeds, it returns a recordset. This recordset can be used by functions such as [[reference:getupdatesql|getUpdateSQL()]] or [[reference:fetchrow|fetchRow()]]. +If the execution succeeds, it returns a recordset. This recordset can be used by functions such as [[v5:reference:connection:getupdatesql|getUpdateSQL()]] or [[v5:reference:recordset:fetchrow|fetchRow()]]. 
-if the execution fails, it returns false. You can access errors using [[reference:errormsg|errorMsg()]].+if the execution fails, it returns false. You can access errors using [[v5:reference:connection:errormsg|errorMsg()]].
 ==== Usage ==== ==== Usage ====
 <code php> <code php>
v5/reference/connection/execute.txt · Last modified: 2023/01/15 20:32 by mnewnham