开发者

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

开发者 https://www.devze.com 2023-03-26 21:28 出处:网络
Here is the PDO code in question: $db->prepare(\"INSERT INTO user (id, name, password, salt, email, join_date, chats)

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

精彩评论

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