mysql_fetch

What is the different between mysql_fetch_array and mysql_fetch_assoc ?
also when we use it?(technical )

thanx for your reply …
No any other different between?

mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both

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_BOTH (default), you’ll get an array with both associative and number indices. Using MYSQL_ASSOC, you only get associative indices (as mysql_fetch_assoc() works), using MYSQL_NUM, you only get number indices (as mysql_fetch_row() works).

Actually mysql_fetch_array return value depends on its second paremeter.

And Indeed the second returns only the associative array. I also seldom use first one because normally use _assoc or _object.

BTW, why don’t you see the PHP Manuals if you already know the function names? There are plenty of examples and good description as well.

mysql_fetch_array fetches an array with numeric keys, e.g.:

array (
0 => ‘some_value’,
1 => ‘some_value’,
2 => ‘some_value’,
3 => ‘some_value’
)

mysql_fetch_assoc fetches an associative array, so the keys are the column names:

array (
‘id’ => ‘some_value’,
‘name’ => ‘some_value’,
‘description’ => ‘some_value’,
‘content’ => ‘some_value’
)

The latter is much handier (IMO), I rarely use the first form.