0

In other people's code I see both being used. So when retrieving database records, which should be used and when?

0

2 Answers 2

3

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.

Sign up to request clarification or add additional context in comments.

Comments

1

just a note:

there are some other functions to get the results of your query like:

  • mysql_fetch_row and
  • mysql_fetch_object

Felix

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.