mysql データベースにデータを挿入する際に問題に直面しています。エラーは次のように表示されます。
<?php
$firstname = $_POST['firstname'];
$lastname = $_POST['lastname'];
$fathername = $_POST['fathername'];
$mothername = $_POST['Firstname'];
$fatherjob = $_POST['fatherjob'];
$motherjob = $_POST['motherjob'];
$phone = $_POST['phone'];
$mobile1 = $_POST['mobile1'];
$mobile2 = $_POST['mobile2'];
$address = $_POST['address'];
$id=1;
$roll=1;
$sex = $_POST['sex'];
$bloodgroup = $_POST['bloodgroup'];
$class = $_POST['class'];
$section = $_POST['section'];
$day = $_POST['day'];
$month = $_POST['month'];
$year = $_POST['year'];
$birthday=$day."-".$month."-".$year;
$hostname_localhost ="localhost";
$database_localhost ="school";
$username_localhost ="root";
$password_localhost ="";
$localhost = mysql_connect($hostname_localhost,$username_localhost,$password_localhost)
or
trigger_error(mysql_error(),E_USER_ERROR);
mysql_select_db($database_localhost, $localhost);
$sql = "INSERT INTO student_info VALUES ('".$id."',".$firstname."','".$lastname."','".$sex."','".$bloodgroup."','".$fathername."','".$mothername ."','".$fatherjob."','".$motherjob."','".$address."','".$birthday."','".$phone."','".$mobile1."','".$mobile2."','".$class."','".$section."','".$roll."')";
mysql_query($sql) or die(mysql_error());
echo "updated succesfully";
?>
ところで、私は自動的に生成されるべき id と roll という名前のテーブルに 2 つの列を持っています...その場合、それは正しい SQL ですか ????