original_string: protected function updateRow()
      {   
          $tableName = $this->getTableName($this->className);
          $assignedValues = $this->getAssignedValues();
          $updateDetails = [];
  
          for ($i = 0; $i < count($assignedValues['columns']); $i++) { 
              array_push($updateDetails, $assignedValues['columns'][$i]  .' =\''. $assignedValues['values'][$i].'\'');
          }
  
          $connection = Connection::connect();
  
          $allUpdates = implode(', ' , $updateDetails);
          $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);
         
          if ($update->execute()) { 
              return 'Row updated';
          } else { 
              throw new Exception("Unable to update row"); 
          }
      }
code: protected function updateRow()
      {   
          $tableName = $this->getTableName($this->className);
          $assignedValues = $this->getAssignedValues();
          $updateDetails = [];
  
          for ($i = 0; $i < count($assignedValues['columns']); $i++) { 
              array_push($updateDetails, $assignedValues['columns'][$i]  .' =\''. $assignedValues['values'][$i].'\'');
          }
  
          $connection = Connection::connect();
  
          $allUpdates = implode(', ' , $updateDetails);
          $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);
         
          if ($update->execute()) { 
              return 'Row updated';
          } else { 
              throw new Exception("Unable to update row"); 
          }
      }
code_tokens: protected function updateRow ( ) { $ tableName = $ this -> getTableName ( $ this -> className ) ; $ assignedValues = $ this -> getAssignedValues ( ) ; $ updateDetails = [ ] ; for ( $ i = 0 ; $ i < count ( $ assignedValues [ 'columns' ] ) ; $ i ++ ) { array_push ( $ updateDetails , $ assignedValues [ 'columns' ] [ $ i ] . ' =\'' . $ assignedValues [ 'values' ] [ $ i ] . '\'' ) ; } $ connection = Connection :: connect ( ) ; $ allUpdates = implode ( ', ' , $ updateDetails ) ; $ update = $ connection -> prepare ( 'update ' . $ tableName . ' set ' . $ allUpdates . ' where id=' . $ this -> resultRows [ 0 ] [ 'id' ] ) ; if ( $ update -> execute ( ) ) { return 'Row updated' ; } else { throw new Exception ( "Unable to update row" ) ; } }
docstring: Edit an existing row
  
  @return bool
docstring_tokens: Edit an existing row