diff options
author | Philip Häusler <msquare@notrademark.de> | 2013-12-01 20:44:32 +0100 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2013-12-01 20:44:32 +0100 |
commit | ef66360f69a0a2cc095c1f938ed634239e5ca576 (patch) | |
tree | 6b262515702e488fa949ab1639438dad9c6238be | |
parent | 347a861da08b2bfab06452a3dd1814c872741e1f (diff) |
fix angeltype assign error
-rw-r--r-- | includes/pages/user_settings.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/pages/user_settings.php b/includes/pages/user_settings.php index 9705fcdf..6b999a2f 100644 --- a/includes/pages/user_settings.php +++ b/includes/pages/user_settings.php @@ -101,7 +101,9 @@ function user_settings() { // Assign angel-types $user_angel_type_info = array(); - 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)) . ")"); + $deleted_angel_types = array_diff(array_keys($angel_types), $selected_angel_types); + if(count($deleted_angel_types) > 0) + 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) if (in_array($angel_type['id'], $selected_angel_types)) $user_angel_type_info[] = $angel_type['name']; |