mysql fetch assoc VS mysql fetch array

后端 未结 10 1858
太阳男子
太阳男子 2020-12-10 04:10

Below are two methods commonly used in most php codes for fetch mysql data .

  1. mysql_fetch_array()
  2. mysql_fetch_assoc()
  3. <
10条回答
  •  粉色の甜心
    2020-12-10 05:06

    I suppose it depends on your definition of big. From that benchmark you can see that it is only before you perform upwards of 1,000,000 million fetches that you actually get a measurable difference? Is your database that big? If not, then go with what is easier for you to use (which is probably to fetch an associative array).

    Another point to consider, if it is so big that there is a measurable difference then I would be getting a way from using functions like that all together. Consider using MySQLi or even better use PDO!

提交回复
热议问题