I'm getting an HTTP error 500, produced by the code below:
else if ($_POST['submit'] == "button2") {
$tbVraag = $_POST['tbVraag'];
$tbText = $_POST['tbText'];
$tbQuestId = $_POST['tbQuestId'];
$UpdateQuest = "UPDATE Vragen SET Title=:Title, `Text`=:txt WHERE QuestionId=:QuestionId";
$stmt = $dbQuiz->prepare($UpdateQuest);
$stmt->bindparam(':Title', $tbVraag);
$stmt->bindparam(':txt', $tbText);
$stmt->bindparam(':QuestionId', $tbQuestId);
$stmt->execute();
$tbAnt1 = $_POST['tbAnt1'];
$UpdateAnt = "UPDATE Antwoorden SET `Text`=:antTxt WHERE AnswerId= ?";
$statement = $dbQuiz->prepare($UpdateAnt);
$statement->bindparam(':antTxt,', $tbAnt1);
$statement->execute();
echo "Update successfully completed!";
}
I have the suspicion that the error is caused by the second question in the code. Here is the error message I'm getting:
Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY093]: Invalid parameter number: mixed named and positional parameters' in /home/lab/domains/u-approachlab.nl/public_html/blendi/Website/opslaan.php:81 Stack trace: #0 /home/lab/domains/u-approachlab.nl/public_html/blendi/Website/opslaan.php(81): PDOStatement->execute() #1 {main} thrown