mysql - Insert into query is not working php -
$sql = "insert `visitors`(`cust_id`, `first_name`, `last_name`, `email_address`, `phone_no`, `st_addr`, `city`, `state`, `zip`, `age`, `ethnicity`, `signup_date`) values (".'$firstname'.", ".'$lastname'.", ".'$email'.", ".'$telephone'.", ".'$street_address'.", ".'$city'.", ".'$state'.",".'$zip'.",".' $age'." , ".'$ethnicity'.",".'$date'.")";
id on auto increment
the number of columns don't match. don't need specify id if autoincrement.
also '$something'
literally insert $something. want use "
insert dynamic data.
$sql = "insert visitors (first_name, last_name, email_address, phone_no, st_addr, city, state, zip, age, ethnicity, signup_date) values ('".$firstname."', '".$lastname."', '".$email."', '".$telephone."', '".$street_address."', '".$city."', '".$state."','".$zip."','". $age."' , '".$ethnicity."','".$date."')";
Comments
Post a Comment