diff options
author | Philip Häusler <msquare@notrademark.de> | 2015-08-09 17:56:03 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2015-08-09 17:56:03 +0200 |
commit | 1dcd6c0f3f46ee48c90e71c36bb4d1fbff5db2ab (patch) | |
tree | 6abb63ea1e9ec48f647d4af0822b28d87eaecfb9 /includes | |
parent | c06573bb875957ab70c808ad469bf0f6173fa2ad (diff) |
fix loggin on setting rooms angeltypes
Diffstat (limited to 'includes')
-rw-r--r-- | includes/pages/admin_rooms.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/includes/pages/admin_rooms.php b/includes/pages/admin_rooms.php index 7f2e3db0..2d5e5ae4 100644 --- a/includes/pages/admin_rooms.php +++ b/includes/pages/admin_rooms.php @@ -98,10 +98,12 @@ function admin_rooms() { sql_query("DELETE FROM `NeededAngelTypes` WHERE `room_id`='" . sql_escape($id) . "'"); $needed_angeltype_info = array(); foreach ($angeltypes_count as $angeltype_id => $angeltype_count) { - $angeltype_source = sql_select("SELECT * FROM `AngelTypes` WHERE `id`='" . sql_escape($angeltype_id) . "' LIMIT 1"); - if (count($angeltype_source) > 0) { + $angeltype = AngelType($angeltype_id); + if ($angeltype === false) + engelsystem_error("Unable to load angeltype."); + if ($angeltype != null) { sql_query("INSERT INTO `NeededAngelTypes` SET `room_id`='" . sql_escape($id) . "', `angel_type_id`='" . sql_escape($angeltype_id) . "', `count`='" . sql_escape($angeltype_count) . "'"); - $needed_angeltype_info[] = $angeltypes_source[0]['name'] . ": " . $angeltype_count; + $needed_angeltype_info[] = $angeltype['name'] . ": " . $angeltype_count; } } |