num_rows < 1) { error("devices", "You are not allowed to edit that device"); } //Update the device $sql = "UPDATE `device` SET `name`='$name', `location`='$location', `description`='$description' WHERE `dev_id`='$device'"; ExecQuery($mysqli, $sql); success("devices", "The device has been updated"); ?>