I have a very simple HTML form, which uses POST to send the data to the PHP script. It gives no errors, just doesn't insert the data into the database. I have checked that the actual data is in the variables, and cannot see any problems with the code.
The script is below:
<?php
$user = $_POST['user']; // get vars from form
$pass = $_POST['pass'];
$fname = $_POST['fname'];
$mname = $_POST['mname'];
$lname = $_POST['lname'];
$fullname = $_POST['fname'] . " " . $_POST['mname'] . " " . $_POST['lname'];
$title = $_POST['title'];
$gender = $_POST['gender'];
$email = $_POST['email'];
$site = $_POST['site'];
$dob = $_POST['dob'];
$upass = md5($pass);
// connect and select db
$cxn = mysqli_connect("localhost","user1","pass","userdb") or die("cannot connect");
//debug testing data is captured correctly - yes
echo $user . $upass . $fullname . $title . $gender . $email . $site . $dob;
$data = "INSERT INTO users (uname, pass, email, site, fname, mname, lname, fullname, gender, title, dob) VALUES ('$user', '$upass', $email, '$site', '$fname', '$mname', '$lname', '$fullname', '$gender', '$title', '$dob')";
$insert = mysqli_query($cxn,$data);
?>