向Access写一个新数据
向Access写一个新数据$Qname = trim($_POST["newadmin"]);
$Qpswd = md5(trim($_POST["password"]));
$times = 0;
$lastlogin = date("Y-m-d H:i");
$sql = "SELECT * FROM manage where username = '{$Qname} '";
$rs = $conn->Execute($sql);
if (!$rs->EOF){
echo "<script>alert(\"该用户名已经存在\");window.history.go(-1)(\");</script>";
exit();
$rs->close();
}
else {
$insql = "insert into manage(username,password,logintimes,lastlogin) values(".$Qname.",".$Qpswd.",".$times.",".$lastlogin.")";
if ($conn->Execute($insql)){
echo ("<script>alert(\"添加成功!\");window.history.go(-1);");
}
}
$conn->close();
[url=]\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\[/url]报错
Fatal error: Uncaught exception 'com_exception' with message '<b>Source:</b> Microsoft JET Database Engine<br/><b>Description:</b> INSERT INTO 语句的语法错误。' in E:\Apple\Apple\manager\savefile.php:25 Stack trace: #0 E:\Apple\Apple\manager\savefile.php(25): com->Execute('insert into man...') #1 {main} thrown in E:\Apple\Apple\manager\savefile.php on line 25
请高手指正下.
ps:俺是新手,对PHP与ACCESS的操作涵数(添加\删除..等)不是很清楚.请别BS..谢谢!