db_update after a submit button is clicked
Although db_update should work with db_set_active in fact db_set_active is completely unnecessary in Drupal 7. Instead of db_update($table, $options) you can do Database::getConnection('default', 'enrollment')-&gt;update($table, $options); a bit more verbose but avoids changing the global state.