sql_query("DELETE FROM `UserAngelTypes` WHERE `user_id`='" . sql_escape($user['UID']) . "' AND `angeltype_id` IN (" . implode(",", array_diff(array_keys($angel_types), $selected_angel_types)) . ")");
sql_query("DELETE FROM `UserAngelTypes` WHERE `user_id`='" . sql_escape($user['UID']) . "' AND `angeltype_id` IN (" . implode(",", $deleted_angel_types) . ")");
foreach ($angel_types_source as $angel_type)
foreach ($angel_types_source as $angel_type)
if (in_array($angel_type['id'], $selected_angel_types))
if (in_array($angel_type['id'], $selected_angel_types))