如何将其插入917678904@tmomail.com
mysql数据库?.
我尝试在它周围加上单引号而没有单引号,但两种方法都失败了。
// This is my query:
$n = 917678904@tmomail.com;
$table = "invites";
if(!mysql_query("INSERT into $dbname.$table (accepted_by, accepted_on, phone, email, reffer)
VALUES('NULL', 'NULL', 'NULL', `$n`, 'NULL'")){
echo mysql_error();
}
这是表结构
accepted_by VARCHAR (50) NOT NULL
accepted_on VARCHAR (45) NOT NULL
phone VARCHAR (11) NULL
email VARCHAR (250) NULL
refferer CHAR (3) NOT NULL)
这是 $n 周围带有单引号的错误消息:
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 '' at line 2
我正在使用 MYSQL 5.0 版