original_string: public function update($table, array $data, $conditions)
      {
          $nameFields = array_keys($data);
          $preparedValues = $this->prepareValues($data);
          $queryString = "UPDATE {$table} SET ";
  
          $fNumber = 0;
          foreach ($preparedValues as $key => $value) {
              unset($value);
              $queryString .= "{$nameFields[$fNumber]} = {$key}, ";
              $fNumber++;
          }
  
          $queryString = preg_replace('/,\ $/', ' ', $queryString);
          $queryString .= "WHERE {$conditions};";
  
          $this->query($queryString, $preparedValues);
  
          return $this->getAffectedRows();
      }
code: public function update($table, array $data, $conditions)
      {
          $nameFields = array_keys($data);
          $preparedValues = $this->prepareValues($data);
          $queryString = "UPDATE {$table} SET ";
  
          $fNumber = 0;
          foreach ($preparedValues as $key => $value) {
              unset($value);
              $queryString .= "{$nameFields[$fNumber]} = {$key}, ";
              $fNumber++;
          }
  
          $queryString = preg_replace('/,\ $/', ' ', $queryString);
          $queryString .= "WHERE {$conditions};";
  
          $this->query($queryString, $preparedValues);
  
          return $this->getAffectedRows();
      }
code_tokens: public function update ( $ table , array $ data , $ conditions ) { $ nameFields = array_keys ( $ data ) ; $ preparedValues = $ this -> prepareValues ( $ data ) ; $ queryString = "UPDATE {$table} SET " ; $ fNumber = 0 ; foreach ( $ preparedValues as $ key => $ value ) { unset ( $ value ) ; $ queryString .= "{$nameFields[$fNumber]} = {$key}, " ; $ fNumber ++ ; } $ queryString = preg_replace ( '/,\ $/' , ' ' , $ queryString ) ; $ queryString .= "WHERE {$conditions};" ; $ this -> query ( $ queryString , $ preparedValues ) ; return $ this -> getAffectedRows ( ) ; }
docstring: Perform a UPDATE statement
  
  @param string $table
  @param array $data
  @param string $conditions
  
  @return int number of affected rows
docstring_tokens: Perform a UPDATE statement