public function update($fields, $table, $where = null)
    {
        self::cleanFields($fields);
        $sql = "UPDATE $table SET ";
        $rows = array();

        foreach ($fields as $key => $val) {
            $rows[] = " `$key` = $val";
        }

        $sql .= implode(', ', $rows) . (!is_null($where) ? ' WHERE ' . $where : null);

        return $this->query($sql);
    }
public function update($fields, $table, $where = null)
    {
        self::cleanFields($fields);
        $sql = "UPDATE $table SET ";
        $rows = array();

        foreach ($fields as $key => $val) {
            $rows[] = " `$key` = $val";
        }

        $sql .= implode(', ', $rows) . (!is_null($where) ? ' WHERE ' . $where : null);

        return $this->query($sql);
    }
public function update ( $ fields , $ table , $ where = null ) { self :: cleanFields ( $ fields ) ; $ sql = "UPDATE $table SET " ; $ rows = array ( ) ; foreach ( $ fields as $ key => $ val ) { $ rows [ ] = " `$key` = $val" ; } $ sql .= implode ( ', ' , $ rows ) . ( ! is_null ( $ where ) ? ' WHERE ' . $ where : null ) ; return $ this -> query ( $ sql ) ; }
A convenience method to update data that exists in the Database. This function
takes an associative array of data to input, with the keys being the column
names and the table. A WHERE statement can be provided to select the rows
to update

@param array $fields
An associative array of data to input, with the key's mapping to the
column names.
@param string $table
The table name, including the tbl prefix which will be changed
to this Symphony's table prefix in the query function
@param string $where
A WHERE statement for this UPDATE statement, defaults to null
which will update all rows in the $table
@throws DatabaseException
@return boolean
A convenience method to update data that exists in the Database . This function takes an associative array of data to input with the keys being the column names and the table . A WHERE statement can be provided to select the rows to update