Problem inserting data int Posted May 12, 2019 Share Posted May 12, 2019 <?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 More sharing options...
dsonesuk Posted May 12, 2019 Share Posted May 12, 2019 IF 'Id' is auto-increment field you don't need to include that in insert statement. You will get mismatch number of field names and values to insert. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now