Домашние задание урок 7.5 PHP/MySQL
Пытаюсь сделать домашнее задание,
выдает
Array ( )
Warning: Undefined variable $name in C:\xampp\htdocs\kinomonstr\music.php on line 25
Warning: Undefined variable $autor in C:\xampp\htdocs\kinomonstr\music.php on line 25
генерирует пустую запись в базу даных
<?php
$mysqli = new mysqli('localhost', 'root', '','kinomontr');
if (mysqli_connect_errno()) {
prinf("nu s-a putut face legatura", mysqli_connect_error());
exit();
}
$mysqli->set_charset('utf8');
$query = $mysqli->query('SELECT * FROM player');
while ($row = mysqli_fetch_assoc($query)) {
echo $row['name'].$row['autor']."<br>";
}
print_r($_POST);
$query = "INSERT INTO player VALUES(null, '$name', '$autor')";
$mysqli->query($query);
$mysqli->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Music</title>
</head>
<body>
<form action="music.php" method="_POST">
<input type="hidden" name="id">
<input type="text" name="name" placeholder="numele caintec">
<input type="text" name="autor" placeholder="autorul">
<input type="submit" value="trimite">
</body>
</html>