Home >Backend Development >PHP Tutorial >PDO 遇到个奇怪的问题

PDO 遇到个奇怪的问题

WBOY
WBOYOriginal
2016-06-23 13:53:32910browse

问题写在图上了


回复讨论(解决方案)

执行这面的语句成功
$stmt3=$pdo->prepare("insert into site (sitename) values (:sitename)");
$stmt3->execute(array(":sitename"=>"asdjasd"));

执行下面的语句失败
$stmt3=$pdo->prepare("insert into site (sitename, keyword, describe) values (:sitename, :keyword, :describe)");
$stmt3->execute(array(":sitename"=>"asdjasd",":keyword"=>"apple",":describe"=>"dassdadadasadads"));

求解~

你把错误打印出来不久可以知道了么?

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW) in D:\xampp\htdocs\test.php on line 28

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn