php mysql 无法插入信息到数据库!!
<?phpinclude("comm.php");$user=$_POST['user'];$ps=$_POST['ps'];$mail=$_POST['mail'];$...
<?php include("comm.php");
$user = $_POST['user']; $ps = $_POST['ps']; $mail = $_POST['mail']; $tele = $_POST['tele']; $qq = $_POST['qq']; $msn = $_POST['msn']; $yb = $_POST['yb']; $add = $_POST['add']; $name = $_POST['name']; $sql = "INSERT INTO us(users,pw,email,tele,qq,add,msn,name,youbian) VALUES('$user','$ps','$mail','$tele','$qq','$add','$msn','$name','$yb')";
$result = mysql_query($sql);
mysql_free_result($result);
mysql_close($conn);
?>
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\bz_proj\re_user.php on line 24问题补充 2011-06-14 10:06把最后二行去掉的话就不会出现警告,但是还是无法向数据库添加信息!!求高手帮忙,小弟不胜感激!!谢谢!! 展开
$user = $_POST['user']; $ps = $_POST['ps']; $mail = $_POST['mail']; $tele = $_POST['tele']; $qq = $_POST['qq']; $msn = $_POST['msn']; $yb = $_POST['yb']; $add = $_POST['add']; $name = $_POST['name']; $sql = "INSERT INTO us(users,pw,email,tele,qq,add,msn,name,youbian) VALUES('$user','$ps','$mail','$tele','$qq','$add','$msn','$name','$yb')";
$result = mysql_query($sql);
mysql_free_result($result);
mysql_close($conn);
?>
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\bz_proj\re_user.php on line 24问题补充 2011-06-14 10:06把最后二行去掉的话就不会出现警告,但是还是无法向数据库添加信息!!求高手帮忙,小弟不胜感激!!谢谢!! 展开
2个回答
2013-09-26
展开全部
你看看这个,就是写进数据库的,参考一下。include("conn.php"); if($_POST['submit']){
$sql="insert into message (id,user,title,content,lastdate) " .
"values ('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
mysql_query($sql);
echo "<script language=\"javascript\">alert('添加成功');history.go(-1)</script>"; }
$sql="insert into message (id,user,title,content,lastdate) " .
"values ('','$_POST[user]','$_POST[title]','$_POST[content]',now())";
mysql_query($sql);
echo "<script language=\"javascript\">alert('添加成功');history.go(-1)</script>"; }
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2013-09-26
展开全部
comm.php里的内容是什么啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询