提示这个错误 哪里不对了?
( ! ) Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ')' in D:\wamp\www\prepare.代码如下
$stnt=$pdo->prepare("insert into blog2 (type,name,num,content)values(:type,:name,:num,:content) ");
$stnt->execute(array("type"->"5","name"->"5","num"->"5","content"->"5"));
?>


回复讨论(解决方案)

$stnt->execute(array(":type"=>"5",":name"=>"5",":num"=>"5",":content"=>"5"));
登录后复制
登录后复制

$stnt->execute(array(":type"=>"5",":name"=>"5",":num"=>"5",":content"=>"5"));
登录后复制
登录后复制


哦 谢谢 冒号还得加上啊

09-15 04:19