对同一个记录集执行2次的问题 mysql_fetch_array 数据指针会下移一条记录...所以,任何一个OK后,应恢复.而一般的做法是你用一次循环,把结果缓存到一个数组里. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 myfuncitonB($result){ while($rs=mysql_fetch_array($result)){ echo $rs['xxx']; echo $rs2['xxx']; }//第一次}写成这样不好吗? myfuncitonB($result){ $result2 = $result; while($rs=mysql_fetch_array($result)){ echo $rs['xxx']; }//第一次 while($rs2=mysql_fetch_array($result2)){ echo $rs2['xxx']; }//第二次} 我用了mrshelly(Shelly)的解决办法通过了代码myfuncitonB($result){ while($rs=mysql_fetch_array($result)){ echo $rs['xxx']; }//第一次mysql_data_seek($result,0);//移动这个记录集的指针 从新指向开始位置 while($rs2=mysql_fetch_array($result)){ echo $rs2['xxx']; }//第二次} 为提高效率,应该把结果缓存到数组里去.myfuncitonB($result){ $dataCache=array(); while($rs=mysql_fetch_array($result)){ $dataCache[]=$rs['xxx']; }//第一次 //第一次 echo implode('',$dataCache); //第二次 echo implode('',$dataCache);} 如何将通过按钮增加的行内容添加到数据库中 php怎样根据数组顺序重新排列css php 如何获取文件上传输入框的真实地址 新人求指点,关于小企业门户建站问题 投票,防止重复投票用什么方法最好?cookie? 在线编辑器无法复制在线播放电影的那段代码 请问一个sql问题:group by精选怎样控制过滤的是同一个值的哪些? 大家进下面这个网址,帮看看怎样改这些错误,谢谢了 PHP正则表达式的一个问题 怎样避免这样的信息出现,我希望是自动再次显示当前页 怎么用preg_replace() 草鸟问简单的问题,怎么才能上传flash,我这个只能上传图片,该怎么改呀
while($rs=mysql_fetch_array($result)){
echo $rs['xxx'];
echo $rs2['xxx'];
}//第一次}
写成这样不好吗?
$result2 = $result;
while($rs=mysql_fetch_array($result)){
echo $rs['xxx'];
}//第一次 while($rs2=mysql_fetch_array($result2)){
echo $rs2['xxx'];
}//第二次}
myfuncitonB($result){
while($rs=mysql_fetch_array($result)){
echo $rs['xxx'];
}//第一次mysql_data_seek($result,0);//移动这个记录集的指针 从新指向开始位置 while($rs2=mysql_fetch_array($result)){
echo $rs2['xxx'];
}//第二次}
myfuncitonB($result){
$dataCache=array();
while($rs=mysql_fetch_array($result)){
$dataCache[]=$rs['xxx'];
}//第一次 //第一次
echo implode('',$dataCache);
//第二次
echo implode('',$dataCache);
}