v5:reference:connection:getinsertsql
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:getinsertsql [2015/09/12 18:15] – [$fieldArray] mnewnham | v5:reference:connection:getinsertsql [2016/03/23 19:15] – [$dontFixQuotes] fix broken link dregad | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== getInsertSql ====== | ====== getInsertSql ====== | ||
+ | ~~NOTOC~~ | ||
<WRAP right box> | <WRAP right box> | ||
== See Also == | == See Also == | ||
- | [[reference: | + | [[v5:reference: |
- | [[reference: | + | [[v5:reference: |
- | [[reference: | + | [[v5:reference: |
Line 21: | Line 21: | ||
===== Parameters ===== | ===== Parameters ===== | ||
==== $recordSet ==== | ==== $recordSet ==== | ||
- | The parameter '' | + | The parameter '' |
- | <code php> | + | * a // |
$SQL = " | $SQL = " | ||
$result = $db-> | $result = $db-> | ||
$sql = $db-> | $sql = $db-> | ||
</ | </ | ||
- | or | + | |
- | <code php> | + | * a //string// specifying a table name <code php> |
$table = ' | $table = ' | ||
$sql = $db-> | $sql = $db-> | ||
- | </ | + | </ |
- | Note that in the second instance, because | + | |
- | <code php> | + | |
/* | /* | ||
* Incorrect syntax | * Incorrect syntax | ||
*/ | */ | ||
$sql = $db-> | $sql = $db-> | ||
- | </ | + | </ |
- | + | ||
- | Also note that in the second example, | + | |
==== $fieldArray ==== | ==== $fieldArray ==== | ||
'' | '' | ||
* Any key in the array that does not match a field name in the table will be discarded before the SQL statement is produced. | * Any key in the array that does not match a field name in the table will be discarded before the SQL statement is produced. | ||
- | * The value of any field in the table that does not appear in the '' | + | * The value of any field in the table that does not appear in the '' |
* Auto-increment fields should not be included in the field list. | * Auto-increment fields should not be included in the field list. | ||
Line 57: | Line 53: | ||
</ | </ | ||
==== $dontFixQuotes ==== | ==== $dontFixQuotes ==== | ||
- | For a description of this behavior see [[reference: | + | For a description of this behavior see [[v5:reference:connection: |
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
<WRAP right tip 300px> | <WRAP right tip 300px> | ||
Line 64: | Line 60: | ||
==== $forceType ==== | ==== $forceType ==== | ||
- | see [[reference: | + | see [[v5:reference: |
------------------------------------------- | ------------------------------------------- | ||
===== Usage ===== | ===== Usage ===== |
v5/reference/connection/getinsertsql.txt · Last modified: 2021/01/25 03:16 by mnewnham