$event="UPDATE events SET description='$description', is_ongoing='$is_ongoing', date_time_end='$end_date_time', user='$user' WHERE event_id='$event_id'";
$unitname_query="SELECT unit_name FROM units AS units INNER JOIN events AS events ON events.unit_id=units.unit_id WHERE events.event_id=".$_POST['event']."";
$alertname_query="SELECT alert_name FROM alerts AS alerts INNER JOIN events AS events ON events.alert_id=alerts.alert_id WHERE events.event_id=".$_POST['event']."";
$message="BMS Unit: ".$unitname."\n Type of Alert: ".$alertname."\n Start Date / Time: ".$start_date_time."\n End Date / Time: ".$end_date_time."\n Description: ".$description."\n Updated by: ".$user."\n Event Link: https://DOMAIN.com/bms/viewevent.php?eventid=$event_id\n\n This message generated by https://DOMAIN.com/bms";