我已经创建了一个将数据导入SQL数据库的表单但是当我填写信息时,我收到了这样的错误:
错误:INSERT INTO andrea22_search(名称,TodayDate,ProjectNumber,Area,DoneBefore,HaveChangesMade,SafeAccess,ElectricalEquipment,MachineGuarding,CorrectEquipment,SDS,ControlToxic,PPE,Hazard,OtherHazard,ControlHazard,MonitorProcess,AdditionalComments)VALUES('Andi' ,'2017-01-03','32a','AS','是','否','N / A','是','否','N / A','是','否”, '', '', '', '是的', '') 表'andrea22_search.andrea22_search'不存在
如果我查看submit.php文件中的代码,我看不到 andrea22_search.andrea22_search 的来源。这个错误当然会阻止我向数据库添加数据。
$dbname = "andrea22_search";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$name = $_POST['input4'];
$date = $_POST['date'];
$projectnumber = $_POST['input1'];
$area = $_POST['input2'];
$donebefore = $_POST['radio9'];
$changesmade = $_POST['radio8'];
$safeaccess = $_POST['radio11'];
$electrical = $_POST['radio5'];
$machineguarding = $_POST['radio6'];
$correctequipment = $_POST['radio4'];
$sds = $_POST['radio3'];
$controltoxic = $_POST['radio1'];
$ppe = $_POST['checkbox[]'];
$otherhazards = $_POST['input3'];
$controlofhazards = $_POST['checkbox1[]'];
$monitor = $_POST['radio12'];
$comments = $_POST['input'];
$sql = "INSERT INTO search (Name, TodayDate, ProjectNumber, Area, DoneBefore, HaveChangesMade, SafeAccess, ElectricalEquipment, MachineGuarding, CorrectEquipment, SDS, ControlToxic, PPE, Hazard, OtherHazard, ControlHazard, MonitorProcess, AdditionalComments) VALUES ('$name', '$date','$projectnumber','$area','$donebefore','$changesmade','$safeaccess','$electrical','$machineguarding','$correctequipment','$sds','$controltoxic','$ppe','$otherhazards','$controlofhazards','$monitor','$comments')";
if ($conn->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn->close();
?>
我哪里出错了?