mysql_fetch_array() fetches a result row as an associative array, a numeric array, or both.
It returns an array of strings that corresponds to the fetched row, or FALSE if there are no more rows. The type of returned array depends on how $result_type is defined.
By using MYSQL_NUM, you only get number indices (as $row[0], $row1, etc) i.e., numeric array.
By using MYSQL_ASSOC, you only get associative indices (as $row["id"], $row["name"], etc) i.e., associative array.
By using MYSQL_BOTH (default), you’ll get an array with both associative and number indices. (as $row[0], $row["name"], etc) i.e., both numeric array and associative array.
mysql_fetch_assoc() fetches a result row as an associative array. (column names as key).
mysql_fetch_object() fetches the result row as an object.
It returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead.
To me there are adantages of using
mysql_fetch_assoc() in that you can use the array functions such as
array_walk and uasort().