I need to insert the data into facilities\_details table that doesn't exits in the table, below code cannot run properly.

```
$facility = $_POST["facilities_cb"];
foreach ($facility as $feature)
{
    mysqli_query($conn,"INSERT INTO facilities_details(facilitiestype_id,hotel_id) values ('$feature','$hid') WHERE NOT EXISTS (SELECT facilitiestype_id FROM facilities_details)");
}

```