标题:向Access写一个新数据
只看楼主
finaly
Rank: 1
来 自:广州
等 级:新手上路
帖 子:80
专家分:0
注 册:2006-6-5
 问题点数:0 回复次数:1 
向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..谢谢!
搜索更多相关主题的帖子: Access 数据 
2008-06-27 10:36
finaly
Rank: 1
来 自:广州
等 级:新手上路
帖 子:80
专家分:0
注 册:2006-6-5
得分:0 
人呢??

http://
2008-06-27 11:17



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-221535-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.157363 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved