Не понимаю в чем проблема SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens
код php
<?php
try {
$conn = new PDO("mysql:host=localhost;dbname=pr17", 'root', '');
if (empty($_POST['main_name'])) exit("Поле не заполнено");
if (empty($_POST['email'])) exit("Поле не заполнено");
if (empty($_POST['note_name'])) exit("Поле не заполнено");
if (empty($_POST['note_text'])) exit("Поле не заполнено");
$query = "INSERT INTO pr17 (author_name, author_email, heading, body_text) VALUES (:main_name, :email, :note_name, :note_text)";
$msg = $conn->prepare($query);
$msg->execute(['main_name'=>$_POST['main_name']]);
$msg->execute(['email'=>$_POST['email'], 'author_email' => $author_email]);
$msg->execute(['note_name'=>$_POST['note_name'], 'heading' => $heading]);
$msg->execute(['note_text'=>$_POST['note_text'], 'body_text' => $body_text]);
echo "aboba<br>";
/*$msg_id = $conn->lastInsertId();*/
header("Location: pr17.html");
}
catch (PDOException $e)
{
echo "error <br>". $e->getMessage();
}
?>
код html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href='pr17.css' rel="stylesheet">
<title>pr17</title>
</head>
<body>
<h1>Введіть свій текст замітки новин до бази даних</h1>
<form method="post" action="pr17.php">
Ім'я
<p><input class = "input_text" type = "text" name = "main_name" size = "10"></p>
Email
<p><input class = "input_text" type = "text" name = "email" size = "30"></p>
Назва замітки
<p><input class = "input_text" type = "text" name = "note_name" size = "20"></p>
Додаткова інформація
<p><input class = "textarea" type = "text" name = "note_text"></p>
<p><input class = "submit" type = "submit" value="Відправити новини!"></p>
</form>
</body>
</html>
Скрин базы данных с phpMyAdmin
