我是准备好的语句的新手,并试图让一些简单的工作。PHP:准备好的语句(新手)出现此错误
这是我的数据库表:
`unblocker_users` (
`uno` bigint(20) NOT NULL AUTO_INCREMENT,
`user_email` varchar(210) DEFAULT NULL,
`pw_hash` varchar(30) DEFAULT NULL,
`email_confirmed` tinyint(4) DEFAULT NULL,
`total_requests` bigint(20) DEFAULT NULL,
`today_date` date DEFAULT NULL,
`accessed_today` tinyint(4) DEFAULT NULL,)
,这是我的函数中插入一些测试数据
function add_new_user($e_mail1)
{
require_once "db.php";
// ####### Below line is giving an error ########
$stmt = $mysqli->prepare("INSERT INTO unblocker_users VALUES ("",?, ?,0,0,?,0)");
$stmt->bind_param('sss', $e_mail1, $this->genRandomString(1),$this->today_date());
$stmt->execute();
$stmt->close();
$done = $stmt->affected_rows;
return $done;
}
正如你可以在上面看到,我都标志着是给我一个行错误。 错误是" Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in..."
我哪里出错了?
谢谢!投了! – Ryan 2011-06-16 14:25:38
所有3个答案都是正确的,但你是第一个,所以我选择你的答案作为正确答案。我希望你能和其他人在一起。 – Ryan 2011-06-16 14:30:12
干杯队友。不要忘记接受答案。我会去@KingCrunch - 哈哈,你可以改变接受的答案。 – martynthewolf 2011-06-16 14:30:14