Our company is developing a big project in which all the things matter for us. So is there any benifit to use fetch_assoc() or is it just a shorcut for usability purposes?
Asked
Active
Viewed 2,737 times
1 Answers
2
Interesting question, it seems that fetch_assoc is slightly faster than fetch_array but I can't find a place talking about a significant difference.
mysqli_fetch_array($res, MYSQL_ASSOC);
is equivalent to
mysqli_fetch_assoc($res);
Personally, for big projects I prefer to use fetch_assoc as a debug friend too. The only significant difference between both functions will be the time you spend searching for bugs when something occurs or when the project needs an update. If there's a trouble with $row["id"], that's kinda easy to find out but $row[1] can be a real pain.

user1780242
- 541
- 1
- 10
- 25

Frederik.L
- 5,522
- 2
- 29
- 41
-
the difference is a typecast. somewhat irrelevant – Danilo Kobold Feb 01 '13 at 22:41