What are some potential pitfalls to be aware of when using the mysql_fetch_array function in PHP?

One potential pitfall when using the mysql_fetch_array function in PHP is that it can return both numeric and associative arrays by default, which may lead to unexpected results if not handled properly. To avoid this issue, you can specify the type of array you want to retrieve by passing the MYSQL_ASSOC or MYSQL_NUM constant as the second parameter in the function.

// Specify the type of array to retrieve
$row = mysql_fetch_array($result, MYSQL_ASSOC);