Heim >Backend-Entwicklung >PHP-Tutorial >运用INSERT INTO语句向数据库中插入数据失败。
include(conn/conn.php);
if($_POST[submit]){
$code = $_POST['code'];
$note = $_POST['note'];
$routeway = $_POST['routeway'];
$operator = $_POST['operator'];
if($code!= "" || $note != "" || $routeway != "" || $operator !=""){
$sql ="INSERT INTO code_group (groupNumber,groupCode,groupNote,groupRouteway,groupOperator) VALUES('','$code','$note','$routeway','$operator')";
if(mysql_query($sql)){
echo"<script>alert('插入成功');</script>";
}else{
echo"<script>alert('插入失败');</script>";
}
}else{
echo"<script>alert('您输入的内容为空');</script>";
}
}
?>