diff --git a/includes/functions.php b/includes/functions.php index 39c0a16dd1..ac24c9e24f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -424,7 +424,7 @@ function delete_device($id) // Remove sensors manually due to constraints foreach (dbFetchRows("SELECT * FROM `sensors` WHERE `device_id` = ?", array($id)) as $sensor) { $sensor_id = $sensor['sensor_id']; - dbDelete('sensors_to_state_indexes', "`sensor_id` = ?", array($sensor)); + dbDelete('sensors_to_state_indexes', "`sensor_id` = ?", array($sensor_id)); } $fields = array('device_id','host'); foreach ($fields as $field) {