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

How to create a table?

1 Answers  


Can you tell the difference between mysql_fetch_object and mysql_fetch_array?

1 Answers  


What is the difference between now() and current_date()?

1 Answers  


What is session variable in mysql?

1 Answers  


How do you start MySQL on Linux?

5 Answers   Cybernet,


What is regexp?

1 Answers  


How to insert dynamic values in mysql using php?

1 Answers  


How do I delete a mysql user?

1 Answers  


Is blocked because of many connection errors unblock with mysqladmin flush hosts?

1 Answers  


can you tell how can you display the maximum salary in sql? : Mysql dba

1 Answers  


Write a query to fetch common records between two tables using mysql?

1 Answers  


What is auto increment in mysql?

1 Answers  


Categories