I am new here...
I am facing a problem in inserting data into database through php.
"Connection is established properly."
Error is:-error in your sql syntax, correct your query.
$firstName = $_POST['firstName'];
$lastname = $_POST['lastname'];
$contact =$_POST['contact'];
$sex = $_POST['gender'];
$dob = $_POST['dob'];
$email = $_POST['email'];
$country = $_POST['country'];
$expr = $_POST['expr'];
$education = $_POST['education'];
$sql = "insert into Login(Firstname, Lastname, Contact, Sex, DOB, E-mail, Country, Experience, Education) values($firstName, $lastname, $contact, $sex, $dob, $email, $country, $expr, $education)";
$result = $conn->query($sql);
if ($result == true)
{
echo "Registered.";
}
else
{
echo "Error: " . $sql . "<br>" . $conn->error;
}
this is my code