我正在研究血库数据库,但我反复收到错误:“字段列表”中的未知列“日期”。php 或 mysql 中没有拼写错误,所以这是我的 php 代码
<?php
$con=mysqli_connect("localhost","root","","bloodbank");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sql="INSERT INTO users (First,Last,Date,Email,Contact,Bloodgroup,Gender,address,City,username,password)
VALUES
('$_POST[first]','$_POST[last]','$_POST[dob]','$_POST[email]','$_POST[contact]','$_POST[bg]',
'$_POST[sex]','$_POST[address]','$_POST[city]','$_POST[username]','$_POST[password]')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
echo "1 record added";
mysqli_close($con);
?></code>