代码如下:
$sql="SELECT * FROM wuliuuser WHERE duname='$uname' AND dupass='$upass'";
$rs=mysql_query($sql, $conn);
结果,print_r(mysql_fetch_assoc($rs)); 的结果为
Array ( [did] => 1 [duname] => wuliu001 [dupass] => 123456 [qyname] => 第一物流公司 [zhizhaono] => [zhizhaopic] => [qyjs] => [rname] => 王磊 [uids] => 1111111111 [utel] => 18603180561 [usheng] => 天津市 [ushi] => 和平区 [udizhi] => 测试地址测试地址 [regtime] => 2014-09-25 07:19:01 [regip] => 60.9.188.175 [ulxly] => 自助注册 [ubeizhu] => 无 [uzt] => 正常 )
说明 qyname这个字段是有内容的,但
echo $rs['qyname'];
结果确是空的,唉,工作了一晚上,可能脑子不动了,完整片段代码为
$sql="SELECT * FROM wuliuuser WHERE duname='$uname' AND dupass='$upass'";
$rs=mysql_query($sql, $conn);
print_r(mysql_fetch_assoc($rs));
echo $rs['qyname'];
------解决思路----------------------
print_r(mysql_fetch_assoc($rs)); 的结果为
echo $rs['qyname'];
改成
$result = mysql_fetch_assoc($rs);
echo $result['qyname'];
$rs只是对象句柄
友情提示:垃圾评论一律封号 加我微信:826096331拉你进VIP群学习群