已经尝试将此错误修复2小时,但没有用。这是我的代码:
$stmt = $conn->prepare("INSERT INTO posts (post_title, post_content, post_timestamp, post_author, post_intro, link, meta_k, meta_d) VALUES (?,?,?,?,?,?,?,?;");
$stmt->bind_param("ssisssss", $post_title, $post_content, $post_timestamp, $post_author, $post_intro, $link, $meta_k, $meta_d);
$stmt->execute();
答案 0 :(得分:3)
这里已多次回答。您的实例中的问题是您的查询中有拼写错误:
$stmt = $conn->prepare("INSERT INTO posts (post_title, post_content, post_timestamp, post_author, post_intro, link, meta_k, meta_d) VALUES (?,?,?,?,?,?,?,?;");
应该是:
$stmt = $conn->prepare("INSERT INTO posts (post_title, post_content, post_timestamp, post_author, post_intro, link, meta_k, meta_d) VALUES (?,?,?,?,?,?,?,?)");
// typo is at the carat: ^
答案 1 :(得分:1)
还有额外的&#39 ;;'在你的VALUES()