v5:reference:connection:getupdatesql
This is an old revision of the document!
Table of Contents
getUpdateSql
See Also
Syntax
string getUpdateSql( mixed $recordSet, string[] $fieldArray, optional bool $forceUpdate=false, optional bool $magicQuotes=false, optional bool $forceType=false )
Description
The function getUpdateSql()
takes a set of parameters and returns an SQL statement that can be used to update a record in the database. It can automatically apply any necessary database specific quoting to character fields and exclude any unchanged variables.
Parameters
$recordSet
The parameter $recordSet
is either a string holding the name of a table, or a recordset obtained by executing a select statement to obtain 1 record.
Acceptable Methods Of Passing Parameter 1
$table = 'ACT'; $sql = $db->getUpdateSql($table,.....
or
$SQL = "SELECT * FROM act WHERE actno=10"; $result = $db->execute($SQL); $sql = $db->getUpdateSql($result,.....
Uncceptable Methods Of Passing Parameter 1
$sql = $db->getUpdateSql('ACT',.....
or
$SQL = "SELECT * FROM act WHERE actno=10"; $result = $db->selectLimit($SQL,1); $sql = $db->getUpdateSql($result,.....
$fieldArray
v5/reference/connection/getupdatesql.1437833710.txt.gz · Last modified: 2017/04/21 11:34 (external edit)