mysql_fetch_array错误问题

来源:百度知道 编辑:UC知道 时间:2024/05/27 19:05:16
<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

mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both
Description
array mysql_fetch_array ( resource $result [, int $result_type= MYSQL_BOTH ] )
加上参数MYSQL_BOTH

把其中$sql=mysql_query("select * from tb_user where usernc='".$nc."'",$conn);
改成$sql=mysql_query("select * from tb_user where usernc='".$nc."'");试试。
最好把你的conn.php也贴出看看。