php - mysql_result 与 mysql_array_assoc

标签 php

使用 mysql_result 和 mysql_array_assoc 循环遍历大型 SQL 选择结果之间是否存在性能差异?

最佳答案

来自mysql_result() manual page :

When working on large result sets, you should consider using one of the functions that fetch an entire row (specified below). As these functions return the contents of multiple cells in one function call, they're MUCH quicker than mysql_result(). Also, note that specifying a numeric offset for the field argument is much quicker than specifying a fieldname or tablename.fieldname argument.

看来mysql_array_assoc() ,引用所指的函数之一,将是您最好的选择。

关于php - mysql_result 与 mysql_array_assoc,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1997739/

相关文章:

javascript - 缩小 : Using regex to remove linebreaks from JavaScript code

php - MySQL:选择一个获胜者,返回他们的排名

javascript - jQuery、AJAX 和 MySQL 中的复选框问题

php - 将 Controller 添加到 Laravel 5 包

php - 在当前日期创建的文件夹和子文件夹中查找文件

php - 如何应用索引该查询

php - mysql 表中的字段向上排序

javascript - 我想在页面刷新时更改背景图像图案。我已经尝试了很多代码,但没有按照我的要求工作

javascript - 如何使用 AJAX/PHP 编辑 mySQL 表中的一行?

php - Magento索引器通过ssh运行但不是cron作业