使用 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/