public function updateRecord($tablename, $parameters, $where)
    {
        $update = array();

        foreach ($parameters as $name => $value) {
            $update[] = "$name = " . $this->quote($value) . "";
        }

        $sql = "UPDATE ". $tablename ." SET ". implode(",", $update) . " WHERE " . $where;

        return $this->write($sql, DatabaseInterface::AFFECTED_ROWS);
    }
public function updateRecord($tablename, $parameters, $where)
    {
        $update = array();

        foreach ($parameters as $name => $value) {
            $update[] = "$name = " . $this->quote($value) . "";
        }

        $sql = "UPDATE ". $tablename ." SET ". implode(",", $update) . " WHERE " . $where;

        return $this->write($sql, DatabaseInterface::AFFECTED_ROWS);
    }
public function updateRecord ( $ tablename , $ parameters , $ where ) { $ update = array ( ) ; foreach ( $ parameters as $ name => $ value ) { $ update [ ] = "$name = " . $ this -> quote ( $ value ) . "" ; } $ sql = "UPDATE " . $ tablename . " SET " . implode ( "," , $ update ) . " WHERE " . $ where ; return $ this -> write ( $ sql , DatabaseInterface :: AFFECTED_ROWS ) ; }
Provides convenience method for updating columns on a table for 1 or
many records matching a WHERE clause

@param string $tablename  Table to update
@param array  $parameters Associative array of columns and values, ex.
<code>
array(
'col1' => 'value of col1',
'col2' => 'value of col2'
)
</code>
@param string $where      Where clause used to find the records to update,
ex. "id = '2'", "title LIKE '%example%' AND status = '2'"

@return int Number of affected rows
@throws DatabaseException if tablename, parameters, or where clause is empty
Provides convenience method for updating columns on a table for 1 or many records matching a WHERE clause