- 论坛徽章:
- 0
|
Not valid mysql result resource
$result = '';
mysql_fetch_array($result);
很新的手啊,,,我初学的时候也知道这个啊...
$result ----你传递进去mysql_fetch_array 这个函数的参数出错了..
把你的sql echo出来放到 mysql 命令行或者 phpmyadmin里面吧.
请教这位大哥,你说的我还是不明白,下面是代码,请你帮我改一下,谢谢!
<html>
<head>
<title>查看昵称</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body topmargin="0" leftmargin="0" bottommargin="0"><br>
<table width="150" height="80" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="60">
<div align="center">
<?php
$nc=trim($_GET[nc]);
if($nc=="")
{
echo "请输入用户昵称!";
}
else
{
include_once("conn.php");
$sql=mysql_query("select * from tb_user where usernc='".$nc."'",$conn);
$info=mysql_fetch_array($sql);
if($info==false)
{
echo "恭喜您,该昵称未被占用!";
}
else
{
echo "对不起,该昵称已被占用!";
}
mysql_close($conn);
}
?>
</div></td>
</tr>
<tr>
<td height="20"><div align="center"><input type="button" onClick="window.close()" value="关闭" class="buttoncss"></div></td>
</tr>
</table>
</body>
</html>
这是出错的图片
|
|