<?php include('includes/config/config.php'); $related_id = $_POST['related_id']; $health_advice =$_POST['health_advice']; $health_cat = $_POST['health_cat']; if(!empty($related_id)){ $query = "update related set health_advice = '$health_advice', health_cat = '$health_cat',modified_by = '".$_SESSION['user_id']."' where related_id = '".$related_id."' "; } else { $query = "insert into related(health_advice,health_cat, modified_by) values ('$health_advice','$health_cat','".$_SESSION['user_id']."' ); "; } if (!$result = @mysqli_query($conn,$query)) { exit(mysqli_error($conn)); } ?>