1
我得到一個錯誤,在我寫一份書面聲明...錯誤與綁定變量
Number of elements in type definition string doesn't match number of bind variables on line 33. Create Topic Insert bind_param() failed:
我能想到的唯一的事情是因爲NOW()
領域,但我認爲這是不需要爲此設置一個變量?
有沒有什麼我明顯缺少在這個或什麼可能會導致此錯誤?
//Prepared INSERT stmt for the forum topic
$stmt = $con->prepare("INSERT INTO forum_topics (`category_id`, `topic_title`, `topic_creator`, `topic_date`, `topic_reply_date`)
VALUES(?, ?, ?, NOW(), NOW())");
if (!$stmt || $con->error) {
die('Create Topic Insert prepare() failed: ' . htmlspecialchars($con->error));
}
if(!$stmt->bind_param('sssii', $cid, $title, $creator)) {
die('Create Topic Insert bind_param() failed: ' . htmlspecialchars($stmt->error));
}
if(!$stmt->execute()) {
die('Create Topic Insert execute() failed: ' . htmlspecialchars($stmt->error));
}
U綁定3 ... sss – Drew