Ok在试图将这一错误插入数据库时
"You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near @email.com, UT, 84505, NOW(), 69.169.186.192) at line 1"
我可以指出这个问题。 下面是我的发言守则。
$insert_query = sprintf("INSERT INTO contacts (first_name, last_name, email, state, zip, date, ip) VALUES (%s, %s, %s, %s, %s, NOW(), %s)",
$fname,
$lname,
$email,
$state,
$zip,
$ip);
$result = mysql_query($insert_query, $connection) or die(mysql_error());
我的议席结构如下:
id int(11)
first_name varchar(100)
last_name varchar(100)
email varchar(100)
state varchar(3)
zip int(10)
date datetime
ip varchar(255)