I want to fetch values from a table in a MySQL database into PHP.
What kind of array will mysql_fetch_array($result) return? Associative or numeric?
I want to fetch values from a table in a MySQL database into PHP.
What kind of array will mysql_fetch_array($result) return? Associative or numeric?
array mysql_fetch_array ( resource $result [, int $result_type = MYSQL_BOTH ] )
It depends on the second parameter which is default MYSQL_BOTH and could be MYSQL_ASSOC, MYSQL_NUM, and MYSQL_BOTH.
More info about mysql_fetch_array.
From the manual:
mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both