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 a heap table?

0 Answers  


What is a storage engine?

0 Answers  


How to calculate the difference between two time values?

0 Answers  


Does insert statement lock the table?

0 Answers  


What is the difference between CHAR and VARCHAR data types?

2 Answers   Ramco,






What is pragma autonomous_transaction?

0 Answers  


Which command is used to view the content of the table in mysql?

0 Answers  


What is the default port number of mysql?

0 Answers  


How does mysql store data?

0 Answers  


What is blob in mysql?

0 Answers  


What are the purposes of using enum and set data types?

0 Answers  


How do you stop an access query?

0 Answers  


Categories