mysql_fetch_assoc vs mysql_fetch_array

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
shiznatix
DevNet Master
Posts: 2745
Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:

mysql_fetch_assoc vs mysql_fetch_array

Post by shiznatix »

Hello everybody!

Ok I have someone who says that mysql_fetch_array is faster than mysql_fetch_assoc. I can not really test this out myself as my other tests on my own server have proven to provide no results that matter compared to everyone elses. So I was wondering if anyone else had any information on this subject and maybe knows about this.

So thats it!
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

From the horses mouth:

http://us3.php.net/manual/en/function.m ... -assoc.php
Performance: An important thing to note is that using mysql_fetch_assoc() is not significantly slower than using mysql_fetch_row(), while it provides a significant added value.
http://us3.php.net/manual/en/function.m ... -array.php
Performance: An important thing to note is that using mysql_fetch_array() is not significantly slower than using mysql_fetch_row(), while it provides a significant added value.
Post Reply