Hello to all,
I am facing an issue in registering values into database through php.
Many times i have done the same but i don't know why i am unable to do this now. Since from 2-3 months, I have not done anything in php.Please help me out..
<?php
include("config.php");
$firstName = mysqli_real_escape_string($conn, $_POST["firstname"]);
$lastname = mysqli_real_escape_string($conn, $_POST["lastname"]);
$contact = mysqli_real_escape_string($conn, $_POST["contact"]);
$sex = mysqli_real_escape_string($conn, $_POST["gender"]);
$dob = mysqli_real_escape_string($conn, $_POST["dob"]);
$email = mysqli_real_escape_string($conn, $_POST["email"]);
$country = mysqli_real_escape_string($conn, $_POST["country"]);
$expr = mysqli_real_escape_string($conn, $_POST["expr"]);
$education = mysqli_real_escape_string($conn, $_POST["education"]);
$sql = "INSERT INTO 'login' (firstname, lastname, contact, sex, dob, email, country, experience, education)
VALUES ('$firstName', '$lastname', '$contact', '$sex', '$dob', '$email', '$country', '$expr', '$education')";
$result = mysqli_query($conn, $sql);
if ($result)
{
echo "New record created successfully";
}
else
{
echo "failed";
}
?>