Drupal 8 Update query 500 error [on hold]

04/07/2018


In a custom module in Drupal 8, I have this query :

$query = Drupal::database () -> 
update ('webform_submission_data', 'n') ->
fields ('n', array ('value' => 'accepted')) -> 
condition ('sid', 1, '=') -> 
condition ('name', 'registration_status', '=') -> 
execute ();

This give error :

TypeError: Argument 2 passed to DrupalCoreDatabaseConnection::update() must be of the type array, string given, called in …

I can not understand what is Argument 2 here and what it mean by must be of the type array !

Thank you for your help.

قالب وردپرس