phprockers-logo

What is the difference between mysql_fetch_object and mysql_fetch_array?

Mysql_fetch_object returns the result from the database as objects while mysql_fetch_array returns result as an array. This will allow access to the data by the field names.

E.g. 
using mysql_fetch_object field can be accessed as $result->name &
using mysql_fetch_array field can be accessed as $result[name]

0 comments:

Post a Comment