ADOdb

Database Abstraction Layer for PHP

User Tools

Site Tools


v5:reference:connection:autoexecute

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
v5:reference:connection:autoexecute [2016/01/17 01:09]
mnewnham ↷ Page moved from v5:reference:autoexecute to v5:reference:connection:autoexecute
v5:reference:connection:autoexecute [2018/07/16 19:25] (current)
peterdd start functions lowercase
Line 21: Line 21:
  
 ===== Description ===== ===== Description =====
-The function ''​autoExecute()''​ can automatically generate and execute INSERT and UPDATE statements on a given table with this function, and is a wrapper for [[v5:​reference:​connection:​getinsertsql|GetInsertSQL()]] and [[v5:​reference:​connection:​getupdatesql|GetUpdateSQL()]]+The function ''​autoExecute()''​ can automatically generate and execute INSERT and UPDATE statements on a given table with this function, and is a wrapper for [[v5:​reference:​connection:​getinsertsql|getInsertSQL()]] and [[v5:​reference:​connection:​getupdatesql|getUpdateSQL()]]
  
-AutoExecute() inserts or updates `$table` given an array of `$arrFields`,​ where the keys are the field names and the array values are the field values to store. Note that there is some overhead because the table is first queried to extract key information before the SQL is generated. An INSERT or UPDATE is generated based on `$mode` (see below). ​+autoExecute() inserts or updates `$table` given an array of `$arrFields`,​ where the keys are the field names and the array values are the field values to store. Note that there is some overhead because the table is first queried to extract key information before the SQL is generated. An INSERT or UPDATE is generated based on `$mode` (see below). ​
  
 ==== $table ==== ==== $table ====
Line 52: Line 52:
 ==== Usage ==== ==== Usage ====
  
-AutoExecute($table, $arrFields, $mode, $where=false,​ $forceUpdate=true,​$magicq=false)+autoExecute($table, $arrFields, $mode, $where=false,​ $forceUpdate=true,​$magicq=false)
  
  
Line 61: Line 61:
 $record["​last_name"​] ​ = "​Smith"; ​ $record["​last_name"​] ​ = "​Smith"; ​
  
-$conn->AutoExecute($table,​$record,'​INSERT'​);​+$conn->autoExecute($table,​$record,'​INSERT'​);​
  
 /* /*
Line 75: Line 75:
 $where ​              = "​last_name like '​Sm%'";​ $where ​              = "​last_name like '​Sm%'";​
  
-$conn->AutoExecute($table,​$record,'​UPDATE',​ $where);+$conn->autoExecute($table,​$record,'​UPDATE',​ $where);
  
 /* /*
Line 91: Line 91:
 $where ​              = "​last_name like '​Sm%'";​ $where ​              = "​last_name like '​Sm%'";​
  
-$conn->AutoExecute($table,​$record,'​UPDATE',​ $where);+$conn->autoExecute($table,​$record,'​UPDATE',​ $where);
  
 /* /*
v5/reference/connection/autoexecute.txt · Last modified: 2018/07/16 19:25 by peterdd