您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

使用mysql_fetch_array()总是没结果

2024/10/23 19:27:56发布22次查看
代码如下: if (!$con) {die('could not connect: ' . mysql_error());} else{ echo nice.
;} mysql_select_db(test, $con); echoget the databse.
; $result =mysql_query(select * from hat_province);echoget the table.
; while($row = mysql_fetch_array($result)) { echo $row['id'] . . $row['province']; echo
; } 在while($row = mysql_fetch_array($result))这里总是停住出不了结果,请问到底为什么出不了结果

回复内容: 代码如下: if (!$con) {die('could not connect: ' . mysql_error());} else{ echo nice.
;} mysql_select_db(test, $con); echoget the databse.
; $result =mysql_query(select * from hat_province);echoget the table.
; while($row = mysql_fetch_array($result)) { echo $row['id'] . . $row['province']; echo
; } 在while($row = mysql_fetch_array($result))这里总是停住出不了结果,请问到底为什么出不了结果

确认你的数据库链接正常后,将while循环放到
if($result){ while(){ }}else{ exit('have no data!');}
调试下,看为什么停住,应该很容易调试出来问题的。
用pdo或者mysqli吧,别再用mysql_开头的函数了
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product