when i submit, it always say "Column 'contact_no' cannot be null" with out the quote.
i have assigned everything right, maybe its a single quote or something.
pls. help me. Thank you.
//recieve the variables
$fname = $_POST['fname'];
$mname = $_POST['mname'];
$lname = $_POST['lname'];
$address = $_POST['haddress'];
$email = $_POST['email'];
$contact = $_POST['contact_no'];
$job = $_POST['job_title'];
$fguess = $_POST['firstguess'];
$sguess = $_POST['secondguess'];
$tguess = $_POST['thirdguess'];
$ip = gethostbyname($_SERVER['REMOTE_ADDR']);
//save the data on the DB
mysql_select_db($database_connection, $connection);
$insert_query = sprintf("INSERT INTO shinygame (fname, mname, lname, haddress, email, contact_no, job_title, firstguess, secondguess, thirdguess, date, ip) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, NOW(), %s)",
sanitize($fname, "text"),
sanitize($mname, "text"),
sanitize($lname, "text"),
sanitize($address, "text"),
sanitize($email, "text"),
sanitize($contact, "text"),
sanitize($job, "text"),
sanitize($fguess, "int"),
sanitize($sguess, "int"),
sanitize($lguess, "int"),
sanitize($ip, "text"));
$result = mysql_query($insert_query, $connection) or die(mysql_error());


Sign In
Create Account


Back to top









