Difference between mysql_fetch_object and mysql_fetch_array

General discussion on PHP
Post Reply
jack9632
Posts: 13
Joined: Fri Feb 22, 2013 8:21 am
Location: 50 Riverside Drive, New York, NY 10024, USA
Contact:

Difference between mysql_fetch_object and mysql_fetch_array

Post by jack9632 » Wed Jun 12, 2013 6:57 am

MySQL fetch object will collect first single matching record wheremysql_fetch_array will collect all matching records from the table in an array.

amar9111
Posts: 18
Joined: Tue Apr 30, 2013 9:48 am

Re: Difference between mysql_fetch_object and mysql_fetch_ar

Post by amar9111 » Thu Jun 13, 2013 11:22 pm

results of mysql_fetch_object can be displayed as below
echo $row->field;
while mysql_fetch_array as
echo $row['field'];

Post Reply