core/classes/PDO.class.php
public function update($table, $data, $where, $conjunction = 'AND'){
        $values = array_merge(array_values($data),array_values($where));
        $keys = array_keys($data);
        $pairs = Array();
        foreach($keys as $key){
            $pairs[] = "{$key}=?";
        }//foreach
        $pairs = implode(',',$pairs);

        $keys = array_keys($where);
        $condition = Array();
        foreach($keys as $key){
            $condition[] = "{$key}=?";
        }//foreach
        $condition = implode(" {$conjunction} ",$condition);

        return $this->query($this->set("UPDATE {$table} SET {$pairs} WHERE {$condition}",$values));

    }
public function update($table, $data, $where, $conjunction = 'AND'){
        $values = array_merge(array_values($data),array_values($where));
        $keys = array_keys($data);
        $pairs = Array();
        foreach($keys as $key){
            $pairs[] = "{$key}=?";
        }//foreach
        $pairs = implode(',',$pairs);

        $keys = array_keys($where);
        $condition = Array();
        foreach($keys as $key){
            $condition[] = "{$key}=?";
        }//foreach
        $condition = implode(" {$conjunction} ",$condition);

        return $this->query($this->set("UPDATE {$table} SET {$pairs} WHERE {$condition}",$values));

    }
public function update ( $ table , $ data , $ where , $ conjunction = 'AND' ) { $ values = array_merge ( array_values ( $ data ) , array_values ( $ where ) ) ; $ keys = array_keys ( $ data ) ; $ pairs = Array ( ) ; foreach ( $ keys as $ key ) { $ pairs [ ] = "{$key}=?" ; } //foreach $ pairs = implode ( ',' , $ pairs ) ; $ keys = array_keys ( $ where ) ; $ condition = Array ( ) ; foreach ( $ keys as $ key ) { $ condition [ ] = "{$key}=?" ; } //foreach $ condition = implode ( " {$conjunction} " , $ condition ) ; return $ this -> query ( $ this -> set ( "UPDATE {$table} SET {$pairs} WHERE {$condition}" , $ values ) ) ; }
Perform an UPDATE statement .

@param string $table The name of the table to update.
@param array $data The data to update the table with, must be an associative array.
@param array $where The conditions specifying what rows should be updated in the table, must be an associative array.
@param string $conjunction The conjunction used to form the where condition of the update statement. Default
is `AND`.

@return mixed
@throws \Disco\exceptions\DBQuery
Perform an UPDATE statement .