Jump to content

I am having problem in inserting data into php mysql kindly sort out error


Problem inserting data int
 Share

Recommended Posts

<?php

$fname=$_POST['fname'];
$lname=$_POST['lname'];
$email=$_POST['email'];
$pass=$_POST['password'];
$country=$_POST['country'];
$mobile=$_POST['mobile'];
$gender=$_POST['gender'];
$con=mysqli_connect('localhost','root','','website');
if($con)
{
echo " Connection is established";
}
$query="INSERT INTO user (`F_Name`, `L_Name`, `Email`, `Password`, `Country`, `Phone`, `Id`) VALUES ('$fname','$lname','$email','$pass','$country','$mobile')";

$run=mysqli_query($con,$query);
if($run == TRUE)
{
echo "Account Successfuly Created";
}
else
{
echo "Errorrrr!!!";
}
?>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...