开发者

PDO::execute() is an undefined method for me?

Here is the PDO code in question:

$db->prepare("INSERT INTO user (id, name, password, salt, email, join_date, chats)
              VALUES (NULL, ?, ?, ?, ?, ?, ?)");
$开发者_如何学编程db->execute(array($name, $password, $salt, $email, $joindate, ''));

I get the fatal error: Fatal error: Call to undefined method PDO::execute() in register.php on line 12, line 12 being the execute above. What could be wrong? The array contains perfect strings, checked them with a print_r.


PDO::prepare returns a PDOStatement object which has the execute method.

$st = $db->prepare(...);
$st->execute(...);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜