1 database_example.module database_example_form_update_submit($form, &$form_state)

Submit handler for the 'update entry' form.

Related topics

File

modules/examples/database_example/database_example.module, line 499
Hook implementations for the Database Example module.

Code

function database_example_form_update_submit($form, &$form_state) {
  global $user;

  // Save the submitted entry.
  $entry = array(
    'pid' => $form_state['values']['pid'],
    'name' => $form_state['values']['name'],
    'surname' => $form_state['values']['surname'],
    'age' => $form_state['values']['age'],
    'uid' => $user->uid,
  );
  $count = database_example_entry_update($entry);
  backdrop_set_message(t("Updated entry @entry (@count row updated)", array('@count' => $count, '@entry' => print_r($entry, TRUE))));
}