首页上一页 1 下一页尾页 1 条记录 1/1页
PHP典型模块大全 第5章
发表在PHP图书答疑
2010-05-13
是否精华
是
否
版块置顶:
是
否
我想问一下:
为什么每次我做注册页面的时候
都会出现这个
Warning;mysql_fetch_array();supplied argument is not a valid MYSQL result resource in D;\www\sc\index_ok.php on line 4
TABLE'db_admin.tb_forum_user'doesn't exist
下面是那个文件的代码
<?php session_start(); include_once("conn/conn.php");
$tb_forum_user=trim($_POST[tb_forum_user]);
$sql=mysql_query("select tb_forum_user from tb_forum_user where tb_forum_user='$tb_forum_user'",$conn);
$info=mysql_fetch_array($sql);
echo mysql_error();
if($info!=false){
echo "<script language='javascript'>alert('对不起,该昵称已被其他用户使用!');history.back();</script>";
exit;
}
$tb_forum_user=trim($_POST[tb_forum_user]);
$tb_forum_pass=md5($_POST[tb_forum_pass]);
$tb_forum_truepass=$_POST[tb_forum_pass];
$tb_forum_email=trim($_POST[tb_forum_email]);
$tb_forum_qq=trim($_POST[tb_forum_qq]);
$tb_forum_pass_problem=trim($_POST[tb_forum_pass_problem]);
$tb_forum_pass_result=trim($_POST[tb_forum_pass_result]);
$tb_forum_date=date("Y-m-d h:i:s");
$tb_forum_speciality=$_POST[tb_forum_speciality];
$tb_forum_picture=$_POST[tb_forum_picture];
$tb_forum_type=1;
$tb_forum_grade=10;
$query=mysql_query("insert into tb_forum_user(tb_forum_user,tb_forum_pass,tb_forum_type,tb_forum_email,tb_forum_truepass,tb_forum_date,tb_forum_picture,tb_forum_qq,tb_forum_grade,tb_forum_pass_problem,tb_forum_pass_result,tb_forum_speciality) values('$tb_forum_user','$tb_forum_pass','$tb_forum_type','$tb_forum_email','$tb_forum_truepass','$tb_forum_date','$tb_forum_picture','$tb_forum_qq','$tb_forum_grade','$tb_forum_pass_problem','$tb_forum_pass_result','$tb_forum_speciality')",$conn);
if($query==true){
session_register("tb_forum_user");
$_SESSION["tb_forum_user"]=$tb_forum_user;
echo "<script>alert('注册成功!');window.location.href='index.php';</script>";
}else{
echo "<script language='javascript'>alert('对不起,注册失败!');history.back();</script>";
exit;
}
?>
非常想知道问题出在哪里 ?谢谢!
为什么每次我做注册页面的时候
都会出现这个
Warning;mysql_fetch_array();supplied argument is not a valid MYSQL result resource in D;\www\sc\index_ok.php on line 4
TABLE'db_admin.tb_forum_user'doesn't exist
下面是那个文件的代码
<?php session_start(); include_once("conn/conn.php");
$tb_forum_user=trim($_POST[tb_forum_user]);
$sql=mysql_query("select tb_forum_user from tb_forum_user where tb_forum_user='$tb_forum_user'",$conn);
$info=mysql_fetch_array($sql);
echo mysql_error();
if($info!=false){
echo "<script language='javascript'>alert('对不起,该昵称已被其他用户使用!');history.back();</script>";
exit;
}
$tb_forum_user=trim($_POST[tb_forum_user]);
$tb_forum_pass=md5($_POST[tb_forum_pass]);
$tb_forum_truepass=$_POST[tb_forum_pass];
$tb_forum_email=trim($_POST[tb_forum_email]);
$tb_forum_qq=trim($_POST[tb_forum_qq]);
$tb_forum_pass_problem=trim($_POST[tb_forum_pass_problem]);
$tb_forum_pass_result=trim($_POST[tb_forum_pass_result]);
$tb_forum_date=date("Y-m-d h:i:s");
$tb_forum_speciality=$_POST[tb_forum_speciality];
$tb_forum_picture=$_POST[tb_forum_picture];
$tb_forum_type=1;
$tb_forum_grade=10;
$query=mysql_query("insert into tb_forum_user(tb_forum_user,tb_forum_pass,tb_forum_type,tb_forum_email,tb_forum_truepass,tb_forum_date,tb_forum_picture,tb_forum_qq,tb_forum_grade,tb_forum_pass_problem,tb_forum_pass_result,tb_forum_speciality) values('$tb_forum_user','$tb_forum_pass','$tb_forum_type','$tb_forum_email','$tb_forum_truepass','$tb_forum_date','$tb_forum_picture','$tb_forum_qq','$tb_forum_grade','$tb_forum_pass_problem','$tb_forum_pass_result','$tb_forum_speciality')",$conn);
if($query==true){
session_register("tb_forum_user");
$_SESSION["tb_forum_user"]=$tb_forum_user;
echo "<script>alert('注册成功!');window.location.href='index.php';</script>";
}else{
echo "<script language='javascript'>alert('对不起,注册失败!');history.back();</script>";
exit;
}
?>
非常想知道问题出在哪里 ?谢谢!