{
$actualRecord = $query[ 0 ];
$updateRequired = FALSE;
$sql = "";
foreach ( $dataToStore[ 'AllFields' ] as $fieldName => $value )
{
if ( $fieldName != "TypeId" )
{
if ( $actualRecord[ $fieldName ] != $value )
{
if ( !in_array( $fieldName, $doNotUpdateField ) )
$sql .= ( $sql != "" ? "," : "" ) . "
`" . $fieldName . "` = '" . $value . "'
";
if ( !in_array( $fieldName, $doesNotForceUpdate ) )
$updateRequired = TRUE;
}
}
}
if ( $sql != "" && $updateRequired )
{
$sql = "
UPDATE
`Records`
SET
" . $sql . "
WHERE
`TypeId` = '" . $dataToStore[ 'AllFields' ][ 'TypeId' ] . "'
LIMIT 1
";
$DataBase->SqlQuery( $sql );
}
$actualRecord = $query[ 0 ];
$updateRequired = FALSE;
$sql = "";
foreach ( $dataToStore[ 'AllFields' ] as $fieldName => $value )
{
if ( $fieldName != "TypeId" )
{
if ( $actualRecord[ $fieldName ] != $value )
{
if ( !in_array( $fieldName, $doNotUpdateField ) )
$sql .= ( $sql != "" ? "," : "" ) . "
`" . $fieldName . "` = '" . $value . "'
";
if ( !in_array( $fieldName, $doesNotForceUpdate ) )
$updateRequired = TRUE;
}
}
}
if ( $sql != "" && $updateRequired )
{
$sql = "
UPDATE
`Records`
SET
" . $sql . "
WHERE
`TypeId` = '" . $dataToStore[ 'AllFields' ][ 'TypeId' ] . "'
LIMIT 1
";
$DataBase->SqlQuery( $sql );
}