Today we were creating a new custom module in Drupal and we had a form we had created and a submit handler. In the submit handler we had a db_update to update the row in the database. For ages we couldn’t find out why it wasn’t working until we noticed we’d set the update variables using
$form_state['values']['name']
This is wrong. This stores the values of the form fields as they were when the form was generated. To get the values of the fields as they were submitted, you need:
$form_state['input']['name']
One of those things that takes hours to spot! ARRRGGHH!!!