我是使用 PDO 的新手,我不知道它有什么问题。它说我有这个错误解析错误:语法错误,意外的 T_ENCAPSED_AND_WHITESPACE,在第 3 行期待 T_STRING 或 T_VARIABLE 或 T_NUM_STRING 这是我的代码。
<?php
include 'dbconnect.php';
$sql = "INSERT INTO event (name,location,admission,map,additional,featured,description) VALUES (:name,:location,:admission,:map,:additional,:featured,:description)";
$q = $conn->prepare($sql);
$q->execute(array(':name'=>$_POST['name'],
':location'=>$_POST['location'],
':admission'=>$_POST['addmission'],
':map'=>$_POST['map'],
':additional'=>$_POST['additional'],
':featured'=>$_POST['featured'],
':description'=>$_POST['description']));
?>