Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result reso php 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 查询失败了!$sql=mysql_query("select * from bg_user where $tj='$key'",$_link) or die(mysql_error()); 逻辑写反了,if($result!=false)这个该循环输出内容的,你alert了。 @flowerfly1988还是不行,他一直出现这个 <?php if(isset($_POST['search_key'])){ $tj=$_POST['select_tj']; var_dump($tj); $key=$_POST['search_key']; var_dump($key); $sql="select * from bg_user where $tj='$key'"; $result=mysql_fetch_array($sql); if($result!=false){ do{ ?> <table border="1" bordercolor="#ccc" width="600" height="400" align="center" cellpadding="0" cellspacing="0"> <tr width="600" height="40"><td colspan="4" bgcolor="#ccc">用户管理</td></tr> <tr width="600" height="40"> <td width="100">用户名:</td> <td><?php echo $result[username];?></td> <td width="100">性别:</td> <td><?=$result['sex']?></td> </tr> <tr width="600" height="40"> <td width="100">邮箱:</td> <td><?php echo $result['email'];?></td> <td width="100">QQ:</td> <td><?=$result['QQ']?></td> </tr> <tr width="600" height="40"> <td width="100">个人主页:</td> <td colspan="3"><?=$result['homepage']?></td> </tr> <tr width="600" height="40"> <td width="100">IP地址:</td> <td></td> <td width="100">生日:</td> <td><?=$result['birthday']?></td> </tr> <tr width="600" height="150"> <td width="100">个人照片:</td> <td colspan="3"><?=$username?></td> </tr> <tr width="600" height="40"> <td width="120">现住城市:</td> <td colspan="3"><?=$result['city']?></td> </tr> <tr width="600" height="40"> <td width="120">家庭住址:</td> <td colspan="3"><?=$result['addr']?></td> </tr> </table> <?php }while($result=mysql_fetch_array($sql)); }else{ echo "<script>alert('对不起,该用户不存在!');</script>"; } } ?> 我的sql语句有没有写错$sql="select * from bg_user where $tj='$key'"; #3中$sql="select * from bg_user where $tj='$key'";$result=mysql_fetch_array($sql); 缺少 mysql_query($sql);不查询,哪来的结果既然是用 mysql 函数族,为何#5截图中是 mysqli_query 出错? @xuzuning加了 mysql_query($sql),但出现这种错误 没有名为“用户名”的列<select name="sel_tj" id="sel_tj"><option value='用户名对应的列名'>用户名</option></select> PHP用jpgraph画曲线图 有关下载的问题,高手请进。 怎么修改数组中的项? header的一个用途请教 如何对div(层)进行分页 怎么使用appserver上传discuz 关于HTML登陆界面的问题。。求助!!! base64解密!逆转! 财经数据抓取,想从网页抓取一段数据,请大神看里面的代码 app引导页与服务器接口怎么写? ThinkPhp3.2放到 linux环境下出现程序内存分配问题 请教个关于B2C建站的问题
$sql=mysql_query("select * from bg_user where $tj='$key'",$_link) or die(mysql_error());
还是不行,他一直出现这个
<?php
if(isset($_POST['search_key'])){
$tj=$_POST['select_tj'];
var_dump($tj);
$key=$_POST['search_key'];
var_dump($key);
$sql="select * from bg_user where $tj='$key'";
$result=mysql_fetch_array($sql);
if($result!=false){
do{
?>
<table border="1" bordercolor="#ccc" width="600" height="400" align="center" cellpadding="0" cellspacing="0">
<tr width="600" height="40"><td colspan="4" bgcolor="#ccc">用户管理</td></tr>
<tr width="600" height="40">
<td width="100">用户名:</td>
<td><?php echo $result[username];?></td>
<td width="100">性别:</td>
<td><?=$result['sex']?></td>
</tr>
<tr width="600" height="40">
<td width="100">邮箱:</td>
<td><?php echo $result['email'];?></td>
<td width="100">QQ:</td>
<td><?=$result['QQ']?></td>
</tr>
<tr width="600" height="40">
<td width="100">个人主页:</td>
<td colspan="3"><?=$result['homepage']?></td>
</tr>
<tr width="600" height="40">
<td width="100">IP地址:</td>
<td></td>
<td width="100">生日:</td>
<td><?=$result['birthday']?></td>
</tr>
<tr width="600" height="150">
<td width="100">个人照片:</td>
<td colspan="3"><?=$username?></td>
</tr>
<tr width="600" height="40">
<td width="120">现住城市:</td>
<td colspan="3"><?=$result['city']?></td>
</tr>
<tr width="600" height="40">
<td width="120">家庭住址:</td>
<td colspan="3"><?=$result['addr']?></td>
</tr>
</table>
<?php
}while($result=mysql_fetch_array($sql));
}else{
echo "<script>alert('对不起,该用户不存在!');</script>";
}
}
?>
$sql="select * from bg_user where $tj='$key'";
$result=mysql_fetch_array($sql);
缺少 mysql_query($sql);
不查询,哪来的结果既然是用 mysql 函数族,为何#5截图中是 mysqli_query 出错?
加了 mysql_query($sql),
但出现这种错误
<option value='用户名对应的列名'>用户名</option>
</select>