What are the differences between MySQL_fetch_array(),
MySQL_fetch_object(), MySQL_fetch_row()?

Answers were Sorted based on User's Feedback



What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?..

Answer / amita

mysql_fetch_object will return result from database as
objects i.e. $result->name
mysql_fetch_array will fetch result row as an associative
array or numeric array or both with the help of mysql_NUM or
mysql_ASSOC option.
eg: $result[0] ,$result['name']
mysql_fetch_row will fetch result row as an numeric array.
eg: $result[0]

Is This Answer Correct ?    4 Yes 0 No

What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?..

Answer / vel

when u r using mysql_fetch_object i will first matching
record.
u can access the result set by column name of that record.

when u r using mysql_fetch_array i will fetch all the
matching records from the table.
u can access the result set by index as well as colum name
of that record.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More MySQL Interview Questions

what is the difference between MyISAM and INNO DB in MySQL with the Advantage and disadvantage

3 Answers   ABC,


What is the difference between unix timestamps and mysql timestamps?

0 Answers  


how to show all records starting with the letters 'sonia' and the phone number '9876543210' limit to records 1 through 5.

0 Answers  


I want to make a query where I want to eliminate the duplicate rows from the table. For example : Input : Table : NAME Column1 Column2 India USA USA India UK India India UK The desired output that I want to eliminate the duplicates Output India USA UK India Thanks

2 Answers   Sun Life,


Is mysql port 3306 tcp or udp?

0 Answers  






Is sql similar to mysql?

0 Answers  


In how many ways we can retrieve the data in the result set of MySQL using PHP? What is the difference between mysql_fetch_object and mysql_fetch_array ?

0 Answers  


What is mysqli_free_result?

0 Answers  


What is blob datatype in mysql?

0 Answers  


How do I disable mysql?

0 Answers  


How do I delete a row in mysql?

0 Answers  


What is orm in mysql?

0 Answers  


Categories