public function update($fields) {
        if (is_array($fields)) {
            foreach ($fields as $key => $value) {
                if (is_string($value)) {
                    array_push($this->_updates, $key . ' = \'' . addslashes($value) . '\'');
                } else {
                    array_push($this->_updates, $key . ' = ' . $value);
                }
            }
        } else {
            return false;
        }
        
        $sql_query = 'UPDATE ' . $this->_table . 
                     ' SET ' . implode($this->_updates, ', ');
        
        // Where statements
        if (count($this->_where)) {
            $sql_query .= ' WHERE ';
            $sql_query .= implode($this->_where, ' AND ');
            
            // or statements
            if (count($this->_or)) {
                $sql_query .= ' OR ';
                $sql_query .= implode($this->_or, ' AND ');
            }
        }
        
        // Set the query
        $this->_sql_query = $sql_query;
        
        return $this;
    }
public function update($fields) {
        if (is_array($fields)) {
            foreach ($fields as $key => $value) {
                if (is_string($value)) {
                    array_push($this->_updates, $key . ' = \'' . addslashes($value) . '\'');
                } else {
                    array_push($this->_updates, $key . ' = ' . $value);
                }
            }
        } else {
            return false;
        }
        
        $sql_query = 'UPDATE ' . $this->_table . 
                     ' SET ' . implode($this->_updates, ', ');
        
        // Where statements
        if (count($this->_where)) {
            $sql_query .= ' WHERE ';
            $sql_query .= implode($this->_where, ' AND ');
            
            // or statements
            if (count($this->_or)) {
                $sql_query .= ' OR ';
                $sql_query .= implode($this->_or, ' AND ');
            }
        }
        
        // Set the query
        $this->_sql_query = $sql_query;
        
        return $this;
    }
public function update ( $ fields ) { if ( is_array ( $ fields ) ) { foreach ( $ fields as $ key => $ value ) { if ( is_string ( $ value ) ) { array_push ( $ this -> _updates , $ key . ' = \'' . addslashes ( $ value ) . '\'' ) ; } else { array_push ( $ this -> _updates , $ key . ' = ' . $ value ) ; } } } else { return false ; } $ sql_query = 'UPDATE ' . $ this -> _table . ' SET ' . implode ( $ this -> _updates , ', ' ) ; // Where statements
 if ( count ( $ this -> _where ) ) { $ sql_query .= ' WHERE ' ; $ sql_query .= implode ( $ this -> _where , ' AND ' ) ; // or statements
 if ( count ( $ this -> _or ) ) { $ sql_query .= ' OR ' ; $ sql_query .= implode ( $ this -> _or , ' AND ' ) ; } } // Set the query
 $ this -> _sql_query = $ sql_query ; return $ this ; }
Update data from table

@param   array   $fields Fields to put in data

@return  mixed   Returns $this when insert succeed and false on failure
Update data from table