function db_set_user_setting

7.x db.inc db_set_user_setting($user_id, $var_name, $value)
6.x db.inc db_set_user_setting($user_id, $var_name, $value)
4.x db.inc db_set_user_setting($user_id, $var_name, $value)
5.x db.inc db_set_user_setting($user_id, $var_name, $value)
1 call to db_set_user_setting()
student_search_display_majors_search in modules/student_search/student_search.module
Display the majors search sub-tab, where we can select a major and see the students assigned to it.

File

includes/db.inc, line 481
This file contains mostly db shortcuts.

Code

function db_set_user_setting($user_id, $var_name, $value) {
  $settings = db_get_user_settings($user_id);
  $settings [$var_name] = $value;

  $ser = serialize($settings);

  db_query("DELETE FROM user_settings WHERE user_id = '?' ", $user_id);
  db_query("INSERT INTO user_settings (user_id, settings, posted)
            VALUES ('?', '?', '?') ", $user_id, $ser, time());
}