v5:reference:connection:autoexecute
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
reference:autoexecute [2015/07/19 16:38] – mnewnham | v5:reference:connection:autoexecute [2021/01/25 03:06] – mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
+ | <WRAP info> | ||
+ | autoExecute is designed to provide a robust simple interface to record updating and insertion. As such, it contains multiple layers of table, column and data validation to ensure data integrity prior to record insertion or update. Consequently, | ||
+ | </ | ||
~~NOTOC~~ | ~~NOTOC~~ | ||
- | |||
<WRAP right box> | <WRAP right box> | ||
+ | == See Also == | ||
+ | [[v5: | ||
== Syntax == | == Syntax == | ||
- | bool AutoExecute( | + | bool autoExecute( |
| | ||
| | ||
| | ||
- | | + | |
- | | + | |
- | | + | |
) | ) | ||
</ | </ | ||
- | <WRAP info> | + | |
- | [[reference: | + | |
- | </ | + | |
===== Description ===== | ===== Description ===== | ||
- | AutoExecute | + | The function '' |
- | AutoExecute() inserts or updates | + | autoExecute() inserts or updates |
==== $table ==== | ==== $table ==== | ||
Line 30: | Line 31: | ||
==== $mode ===== | ==== $mode ===== | ||
- | Legal values for `$mode` are | + | Legal values for ` $mode ` are |
^String^Integer^Constant^ | ^String^Integer^Constant^ | ||
Line 39: | Line 40: | ||
The $where clause is required if $mode == ' | The $where clause is required if $mode == ' | ||
- | ==== $forceupdate | + | ==== $forceUpdate |
^Value^Description^Overhead^ | ^Value^Description^Overhead^ | ||
Line 45: | Line 46: | ||
|true|All fields provided are updated|The constructed statement may be considerably larger| | |true|All fields provided are updated|The constructed statement may be considerably larger| | ||
- | ==== $magicq ==== | ||
- | ^Value^Description^ | ||
- | |false|Does not attempt to quote special characters in character fields e.g. \0| | ||
- | |true|Attempts to quote special characters, e.g. \0 becomes \\\0 to allow database insertion| | ||
- | |||
==== Usage ==== | ==== Usage ==== | ||
- | AutoExecute($table, $arrFields, $mode, $where=false, | + | autoExecute($table, $arrFields, $mode, $where=false, |
Line 58: | Line 54: | ||
<code php> | <code php> | ||
$table | $table | ||
- | $record[" | + | $record[" |
- | $record[" | + | $record[" |
- | $conn->AutoExecute($table, | + | $conn->autoExecute($table, |
/* | /* | ||
- | * result executes " | + | * result executes " |
*/ | */ | ||
</ | </ | ||
Line 71: | Line 67: | ||
<code php> | <code php> | ||
$table | $table | ||
- | $record[" | + | $record[" |
- | $record[" | + | $record[" |
- | $where | + | $where |
+ | |||
+ | $conn-> | ||
+ | |||
+ | /* | ||
+ | * result executes " | ||
+ | */ | ||
+ | </ | ||
+ | |||
+ | In situations where the table names contain certain special characters, such as dashes, the [[v5: | ||
+ | |||
+ | <code php> | ||
+ | $ADODB_QUOTE_FIELDNAMES = ' | ||
+ | $table | ||
+ | $record[" | ||
+ | $record[" | ||
+ | $where | ||
- | $conn->AutoExecute($table, | + | $conn->autoExecute($table, |
/* | /* | ||
- | * result executes " | + | * result executes " |
*/ | */ | ||
</ | </ |
v5/reference/connection/autoexecute.txt · Last modified: 2021/01/25 03:07 by mnewnham