Monday, May 13, 2013

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 and using
mysql_fetch_array field can be accessed as $result->[name]

No comments:

Post a Comment