v5:reference:connection:getupdatesql
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:getupdatesql [2015/07/25 23:47] – mnewnham | v5:reference:getupdatesql [2016/01/13 02:31] – ↷ Links adapted because of a move operation mnewnham | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== getUpdateSql ====== | ====== getUpdateSql ====== | ||
+ | ~~NOTOC~~ | ||
<WRAP right box> | <WRAP right box> | ||
== See Also == | == See Also == | ||
- | [[reference: | + | [[v5:reference: |
== Syntax == | == Syntax == | ||
string getUpdateSql( | string getUpdateSql( | ||
- | obj $recordSet, | + | obj $result, |
string[] $fieldArray, | string[] $fieldArray, | ||
optional bool $forceUpdate=false, | optional bool $forceUpdate=false, | ||
Line 16: | Line 16: | ||
===== Description ===== | ===== Description ===== | ||
The function '' | The function '' | ||
+ | ------------------ | ||
===== Parameters ===== | ===== Parameters ===== | ||
- | ==== $recordSet | + | ==== $result==== |
- | The parameter '' | + | The parameter '' |
<code php> | <code php> | ||
Line 28: | 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> | <WRAP right tip 300px> | ||
Line 38: | Line 41: | ||
</ | </ | ||
==== $dontFixQuotes ==== | ==== $dontFixQuotes ==== | ||
- | For a description of this behavior see [[reference: | + | For a description of this behavior see [[v5:reference: |
-------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | ||
<WRAP right tip 300px> | <WRAP right tip 300px> | ||
- | This parameter was designed to provide backwards with now unsupported versions of ADOdb and may be removed in future releases. | + | This parameter was designed to provide backwards |
</ | </ | ||
==== $forceType ==== | ==== $forceType ==== | ||
- | see [[reference: | + | see [[v5:reference: |
------------------------------------------- | ------------------------------------------- | ||
===== Usage ===== | ===== Usage ===== | ||
Line 79: | Line 82: | ||
print $SQL | print $SQL | ||
/* | /* | ||
- | * returns: UPDATE employees SET FIRST_NAME=' | + | * returns: UPDATE employees |
+ | | ||
+ | | ||
+ | | ||
*/ | */ | ||
</ | </ | ||
Line 91: | Line 97: | ||
/* | /* | ||
* returns | * returns | ||
- | * UPDATE employees SET FIRST_NAME=' | + | * UPDATE employees SET FIRST_NAME=' |
+ | | ||
+ | | ||
+ | | ||
*/ | */ | ||
</ | </ |
v5/reference/connection/getupdatesql.txt · Last modified: 2023/09/26 17:43 by dregad