v5:reference:connection:getupdatesql
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
reference:getupdatesql [2015/10/14 16:41] – mnewnham | v5:reference:connection:getupdatesql [2023/09/26 17:43] (current) – Fix broken link to execute() page dregad | ||
---|---|---|---|
Line 3: | Line 3: | ||
<WRAP right box> | <WRAP right box> | ||
== See Also == | == See Also == | ||
- | [[reference: | + | [[v5:reference: |
== Syntax == | == Syntax == | ||
Line 10: | Line 10: | ||
string[] $fieldArray, | string[] $fieldArray, | ||
optional bool $forceUpdate=false, | optional bool $forceUpdate=false, | ||
- | optional bool $dontFixQuotes=false, | + | optional bool $placeHolder=false, |
optional bool $forceType=null | optional bool $forceType=null | ||
) | ) | ||
Line 19: | Line 19: | ||
===== Parameters ===== | ===== Parameters ===== | ||
==== $result==== | ==== $result==== | ||
- | The parameter '' | + | The parameter '' |
<code php> | <code php> | ||
Line 29: | Line 29: | ||
'' | '' | ||
<code php> | <code php> | ||
- | $ar = array(' | + | $ar = array(' |
</ | </ | ||
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
==== $forceUpdate ==== | ==== $forceUpdate ==== | ||
- | '' | + | '' |
+ | |||
+ | In addition, use of this parameter eliminates the need to add additional testing to determine if any fields have changed. In cases such as these, if the parameter is not set and there have been no modified fields, the getUpdateSql() method will return an empty string, causing [[v5: | ||
------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ||
- | <WRAP right tip 300px> | + | ==== $placeHolder |
- | Use of this parameter is tied to the now removed '' | + | This argument was previously used for information about deprecated PHP functionality, |
- | </ | + | |
- | ==== $dontFixQuotes | + | |
- | For a description of this behavior see [[reference: | + | |
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
<WRAP right tip 300px> | <WRAP right tip 300px> | ||
Line 46: | Line 45: | ||
==== $forceType ==== | ==== $forceType ==== | ||
- | see [[reference: | + | see [[v5:reference: |
------------------------------------------- | ------------------------------------------- | ||
===== Usage ===== | ===== Usage ===== | ||
Line 70: | Line 69: | ||
$SQL = ' | $SQL = ' | ||
- | $result = $db->Execute($SQL); | + | $result = $db->execute($SQL); |
$updateArray = array(' | $updateArray = array(' | ||
Line 76: | Line 75: | ||
' | ' | ||
- | $SQL = $db-> | + | $SQL = $db-> |
- | + | ||
- | print $SQL | + | |
/* | /* | ||
- | * returns: UPDATE employees SET FIRST_NAME=' | + | * returns |
+ | | ||
+ | | ||
+ | | ||
+ | | ||
*/ | */ | ||
</ | </ | ||
Line 89: | Line 90: | ||
<code php> | <code php> | ||
- | $SQL = $db-> | + | $SQL = $db-> |
/* | /* | ||
* returns | * returns | ||
- | * UPDATE employees SET FIRST_NAME=' | + | * UPDATE employees SET FIRST_NAME=' |
+ | | ||
+ | | ||
+ | | ||
*/ | */ | ||
</ | </ |
v5/reference/connection/getupdatesql.1444833665.txt.gz · Last modified: 2017/04/21 11:34 (external edit)