I wanna to know the difference between mysql_fetch_Assoc and mysql_fetch_Array..I am a little bit confused at its usage..Kindly provide with a sample example also...Any help would be appreciated

Recommended Answers

All 2 Replies

mysql_fetch_assoc will return an array indexed by the column values specified in the select part of your query, whereas mysql_fetch_array will return a numerically indexed array with values in the order specified in the select part of your query.

Addition: mysql_fetch_array actually returns both the numerical and the associative by default.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.