if(isset($_POST['submit']))
{
if(!empty($_POST['name']) && ($_POST['id']) && ($_POST['contact_id']) && ($_POST['gender']) && ($_POST['email_id']) && ($_POST['role']) && ($_POST['status'])) && ($_POST['date']))
{
$name= $_POST['name'];
$id = $_POST['id'];
$contact_id = $_POST['contact_id'];
$gender = $_POST['gender'];
$email_id = $_POST['email_id'];
$role = $_POST['role'];
$status = $_POST['status'];
$date =$_POST['date'];
$query "insert into emp(name,id,contact_id,gender,email_id,role,status,date) values('$name', '$id', '$contact_id', '$gender', '$email_id', ' $role', ' $status', '$date')";
$run =mysqli_query($conn,$query) or die(mysqli_error());
if ($run) {
echo " Form submitted successfully";
}
else{
echo "form not submitted";
}
}
else
{
echo "All fields are required";
}
else
{
die("connection failled because".mysqli_connect_error());
}
}
?>
What I have tried:
pls solve my errors
.