while遍历结果集
for遍历。
$num=mysql_num_rows($result);
for($i=0;$i<$num;$i++)
{
$row=mysql_fetch_assoc($result);
$arr[]=$row;
}
while的条件怎么填- -。 貌似我好像见过。貌似忘了。
------解决方案--------------------
while($row=mysql_fetch_assoc($result)){
$arr[]=$row;
}
0
0
while遍历结果集
for遍历。
$num=mysql_num_rows($result);
for($i=0;$i<$num;$i++)
{
$row=mysql_fetch_assoc($result);
$arr[]=$row;
}
while($row=mysql_fetch_assoc($result)){
$arr[]=$row;
}
相关文章
如何从PHP中调用Python文件?
我们如何使用使用mysql_fetch_assoc()函数的PHP脚本来显示MySQL表中的所有记录?
ini_set()在PHP中的作用是什么?
在PHP中的readlink()函数
我们如何编写PHP脚本来释放与MySQL结果关联的游标内存?
相关标签:
本站声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
热门AI工具
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号