v5:reference:connection:autoexecute
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
reference:autoexecute [2015/07/22 16:33] – mnewnham | v5:reference:connection:autoexecute [2021/01/25 03:05] – [Description] mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | ~~NOTOC~~ | + | |
- | <WRAP important> | + | |
- | Because the '' | + | |
- | </ | + | |
<WRAP info> | <WRAP info> | ||
- | [[reference: | + | 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~~ | ||
<WRAP right box> | <WRAP right box> | ||
+ | == See Also == | ||
+ | [[v5: | ||
== Syntax == | == Syntax == | ||
- | bool AutoExecute( | + | bool autoExecute( |
| | ||
| | ||
| | ||
| | ||
- | | + | |
- | | + | |
) | ) | ||
Line 22: | Line 20: | ||
===== Description ===== | ===== Description ===== | ||
- | AutoExecute | + | The function '' |
- | AutoExecute() inserts or updates | + | autoExecute() inserts or updates |
==== $table ==== | ==== $table ==== | ||
Line 33: | Line 31: | ||
==== $mode ===== | ==== $mode ===== | ||
- | Legal values for `$mode` are | + | Legal values for ` $mode ` are |
^String^Integer^Constant^ | ^String^Integer^Constant^ | ||
Line 42: | 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 48: | 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 61: | Line 54: | ||
<code php> | <code php> | ||
$table | $table | ||
- | $record[" | + | $record[" |
- | $record[" | + | $record[" |
- | $conn->AutoExecute($table, | + | $conn->autoExecute($table, |
/* | /* | ||
- | * result executes " | + | * result executes " |
*/ | */ | ||
</ | </ | ||
Line 74: | 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