Click here to Skip to main content
15,034,432 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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



























.
Posted
Updated 16-Jun-21 23:57pm

1 solution

Too many brackets...
PHP
if(!empty($_POST['name']) && ... && ($_POST['status'])) && ($_POST['date']))
                                                      ^
                                                      |
   
Comments
Richard MacCutchan 17-Jun-21 7:05am
   
Parentheses!
OriginalGriff 17-Jun-21 7:18am
   
Tomato ... Solanum lycopersicum,
Let's call the whole thing off!

:D
Richard MacCutchan 17-Jun-21 7:22am
   
Or maybe brockits.
OriginalGriff 17-Jun-21 8:11am
   
"Parckets"?
Richard MacCutchan 17-Jun-21 8:33am
   
Parakeets?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900