所出现的错误:
Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '1' at line 1
对应的sql语句:
$ins= mysql_query("insert into employee_table (Employee_id,Employee_password,Employee_name,
Employee_birthday,Entry_date,department,Position,remark,Employee_photo)
values('$id','$pas','$name','$birthday','$date','$depart','$position','$remarks','$photo')");
if (!mysql_query($ins,$con)){
die('Error: ' . mysql_error());
}
else echo '1 record added';
关键是我对应的php文件里根本没有出现‘1’,搜了一下说是sql语句出了问题,可是到最后也没发现sql语句有什么问题,但把$ins改成这样就行了
$ins="insert into employee_table (Employee_id,Employee_password,Employee_name,
Employee_birthday,Entry_date,department,Position,remark,Employee_photo)
values('$id','$pas','$name','$birthday','$date','$depart','$position','$remarks','$photo')";
if (!mysql_query($ins,$con)){
die('Error: ' . mysql_error());
}
else echo '1 record added';