mysqlfetcharray
mysql_fetch_array is a PHP function that retrieves a row from a MySQL query result as an array. It returns the row as an associative array (column names as keys), a numeric array (column positions as keys), or both, depending on the second argument. The default behavior is to return both types. The function accepts two parameters: the result resource created by mysql_query and an optional result type constant. The constants MYSQL_ASSOC, MYSQL_NUM, and MYSQL_BOTH indicate which variant of array the caller wants. The function returns FALSE when no more rows are available or an error occurs.
The function was part of the legacy MySQL extension, which was deprecated in PHP 5.5 and removed
Typical usage of mysql_fetch_array had the following pattern:
$result = mysql_query('SELECT id, name FROM users');
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
// process $row['id'] and $row['name']
}
Because the legacy MySQL extension is no longer available, new applications should focus on PDO or mysqli
---