データベースに接続してからテーブルを更新する必要がある php スクリプトにフォームからデータを送信しています。これは基本的に、すべての登録ユーザーのデータベースです。何らかの理由で、データベース テーブルが値で更新されていません。
フォーム コードは次のとおりです。
<body>
<div class="header">
Registration
</div>
<div class="content" style="text-align:center";>
<form name="input" action="success.php" method="post"><br>
First name: <input type="text" name="firstname"><br/>
Last name: <input type="text" name="lastname"><br/>
Age: <input type="text" name="age"><br/>
Date of Birth: <input type="text" name="dateofbirth"><br/>
Email: <input type="text" name="email"><br/>
<input type="submit" value="Submit"><br/><br>
</form>
</div>
<br><br><a href="index.html" style="font-size: 22px";>Back</a>
</body>
そして、私が持っているphpコードは次のとおりです。
<?php
$con=mysqli_connect("example.com","myname","123","database1");
$sql="INSERT INTO user (fname, lname, age, dob, email) VALUES ('$_POST[firstname]','$_POST[lastname]','$_POST[age]','$_POST[dateofbirth]','$_POST[email]')";
mysqli_query($sql);
mysqli_close($con);
?>
誰かが私が間違っているところを教えてもらえますか?? データベースが更新されていません。テーブルに値が入力されていません。