How to run, execute insert query in Drupal 8
“There may be several other possible ways, but I know one simple one and sticked to it.
$db = \Drupal::database();
$db->insert($table_name)->fields($fields_array_key_value_pair)->execute();
Thats it.
“
Leave a Reply