php通过username查询数据报错。
使用纯数字用户名查询可以正常出结果,但是使用字母用户名就会报错,如下Warning:mysql_num_rows()expectsparameter1toberesour...
使用纯数字用户名查询可以正常出结果,但是使用字母用户名就会报错,如下
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\jiansu_shop\admin\admin_query_list.php on line 63
代码如下:
60 <?php
61 require 'conn.php';
62 $sql = mysql_query("select * from shop_user where username=$username");
63 $datarow = mysql_num_rows($sql);
64 for($i=0;$i<$datarow;$i++){
65 $sql_arr = mysql_fetch_assoc($sql);
$uid = $sql_arr['uid'];
$username = $sql_arr['username'];
$password = $sql_arr['pwd'];
$email = $sql_arr['email'];
$regdate = $sql_arr['reg_time'];
$add=$sql_arr['address'];
$phone=$sql_arr['phone'];
$consignee=$sql_arr['consignee'];
财富值不够了。。。就这些了,, 展开
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\jiansu_shop\admin\admin_query_list.php on line 63
代码如下:
60 <?php
61 require 'conn.php';
62 $sql = mysql_query("select * from shop_user where username=$username");
63 $datarow = mysql_num_rows($sql);
64 for($i=0;$i<$datarow;$i++){
65 $sql_arr = mysql_fetch_assoc($sql);
$uid = $sql_arr['uid'];
$username = $sql_arr['username'];
$password = $sql_arr['pwd'];
$email = $sql_arr['email'];
$regdate = $sql_arr['reg_time'];
$add=$sql_arr['address'];
$phone=$sql_arr['phone'];
$consignee=$sql_arr['consignee'];
财富值不够了。。。就这些了,, 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询