Reputation: 3
In other people's code I see both being used. So when retrieving database records, which should be used and when?
Upvotes: 0
Views: 432
Reputation: 2707
just a note:
there are some other functions to get the results of your query like:
Felix
Upvotes: 1
Reputation: 806
mysql_fetch_array() is more generic than mysql_fetch_assoc(), although it can generate the exact same results using proper parameters.
However, if you only need an associative array, I would advise you to use the latter, as the former makes the code more ambiguous or heavy, depending on how you use it.
Upvotes: 3