这是我写的一个函数的代码:function sql_fetch_array_batch($query_id = 0)
{
while ($result[] = @mysql_fetch_array($query_id)) {
}
unset($result[count($result)-1]);
return $result;
}执行这个函数用了0.49秒,各位看看有没有更好的办法
{
while ($result[] = @mysql_fetch_array($query_id)) {
}
unset($result[count($result)-1]);
return $result;
}执行这个函数用了0.49秒,各位看看有没有更好的办法
解决方案 »
- 【精华】架构合理+强大的PHP框架再次推荐,傲视群雄~~~~
- 急求
- php读取textarea的问题,在线等
- 前缀不同可以恢复数据么
- phpsmarty插空函数问题~
- 怎样把多个pdf文件压缩成一个zip文件?急!!!!!!!
- 有没有代替session功能的东西
- foreach循环中$p[] = $MaterialType 的疑问
- 为了庆祝我们伟大的祖国,快来呀
- php+mysql实现视频播放
- 怎样通过第一个下拉框选择的内容来控制第二个下拉框显示的选项?(不用javascript,因为数据太多了)?
- 为什么我安装(php4.3.2+IIS5.0+MySQL)完成后,运行phpinfo();而什么都没有显示??(在线)
{
// if ($this->_arr) return $this->_arr;
$results = array();
$cnt = 0;
while (!$this->EOF && $nRows != $cnt) {
$results[$cnt++] = $this->fields;
$this->MoveNext();
}
return $results;
}
方法都是差不多的。
你用mysql_fetch_row()试试。
这个办法不行,还不如我的省时间
while ($result[] = @mysql_fetch_array($query_id)) {
}
unset($result[count($result)-1]);的时间是0.49s,可是直接使用就用了0.26s,这是什么原因呢