What is the difference between mysql_fetch_array and mysql_fetch_object?

Posted by Editorial Staff | Updated on

Want to know the difference between mysql_fetch_array and mysql_fetch_object, then this answer is for you.

MySQL mysql_fetch_array() Function

The mysql_fetch_array() function returns a row from a recordset as an associative array and/or a numeric array. This function gets a row from the mysql_query() function and returns an array on success, or FALSE on failure or when there are no more rows.

Example: MySQL mysql_fetch_array() example.

MySQL mysql_fetch_object() Function
The mysql_fetch_array() function returns a row from a recordset as an associative array and/or a numeric array. This function gets a row from the mysql_query() function and returns an array on success, or FALSE on failure or when there are no more rows.

Example: mysql_fetch_object() example


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers