original_string: public function update($fields)
      {
          // Set fields
          $this->fields($fields);
  
          // Resolve fields
          $fields = $this->getUpdateFieldsString();
  
          // Define wheres
          $where = $this->getWhereString();
  
          // Build query
          $this->query = 'UPDATE ' . $this->table . ' SET ' . $fields . ' '. $where;
  
          // Prepare statement
          $this->statement = $this->pdo->prepare($this->query);
  
          // Bind fields values
          $this->bindFields();
  
          // Bind where values
          if (count($this->wheres)) {
              $this->bindWheres();
          }
  
          // Execute statement
          $result = $this->statement->execute();
  
          // Reset values
          $this->reset();
  
          // Return result
          return $result;
      }
code: public function update($fields)
      {
          // Set fields
          $this->fields($fields);
  
          // Resolve fields
          $fields = $this->getUpdateFieldsString();
  
          // Define wheres
          $where = $this->getWhereString();
  
          // Build query
          $this->query = 'UPDATE ' . $this->table . ' SET ' . $fields . ' '. $where;
  
          // Prepare statement
          $this->statement = $this->pdo->prepare($this->query);
  
          // Bind fields values
          $this->bindFields();
  
          // Bind where values
          if (count($this->wheres)) {
              $this->bindWheres();
          }
  
          // Execute statement
          $result = $this->statement->execute();
  
          // Reset values
          $this->reset();
  
          // Return result
          return $result;
      }
code_tokens: public function update ( $ fields ) { // Set fields $ this -> fields ( $ fields ) ; // Resolve fields $ fields = $ this -> getUpdateFieldsString ( ) ; // Define wheres $ where = $ this -> getWhereString ( ) ; // Build query $ this -> query = 'UPDATE ' . $ this -> table . ' SET ' . $ fields . ' ' . $ where ; // Prepare statement $ this -> statement = $ this -> pdo -> prepare ( $ this -> query ) ; // Bind fields values $ this -> bindFields ( ) ; // Bind where values if ( count ( $ this -> wheres ) ) { $ this -> bindWheres ( ) ; } // Execute statement $ result = $ this -> statement -> execute ( ) ; // Reset values $ this -> reset ( ) ; // Return result return $ result ; }
docstring: Performs an UPDATE query
  
  @param array $fields Array of columns names and values to insert
  @return bool Query success or fail
docstring_tokens: Performs an UPDATE query