mysql_fetch_array and mysql_fetch_row do exactly the same thing. There is no difference. In fact the only difference is fetch_row returns the array with numerical indices like
PHP Code:
while($row = mysql_fetch_row($result)) {
print $row[0];
}
While mysql_fetch_array() returns both numerical and named indices like:
PHP Code:
while($row = mysql_fetch_row($result)) {
print $row['fieldname'];
//or
print $row[0];
}
//these will prdocue the same results.
On a side note mysql_fetch_array() takes an optional param of what kind of result to return.
PHP Code:
mysql_fetch_row($result, MYSQL_ASSOC)
//Returns only named indices
PHP Code:
mysql_fetch_row($result, MYSQL_NUM)
//Returns only numbered indices
PHP Code:
mysql_fetch_row($result, MYSQL_BOTH)
//Returns both same as
mysql_fetch_row($result)
Bookmarks