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 mysql in dbms?

0 Answers  


What is localhost in mysql?

0 Answers  


using primary can we relate two table, with out foreign key?

0 Answers  


State the differences between mongodb and mysql.

0 Answers  


How to update database permissions/privilages.

0 Answers  






What is the difference between mysql_fetch_assoc and mysql_fetch_array?

0 Answers  


What is mysql optimization?

0 Answers  


What is slow query log in mysql?

0 Answers  


Why do we need mysql?

0 Answers  


How to use regular expression in pattern match conditions?

0 Answers  


How set mysql root password?

0 Answers  


What is check constraint?

3 Answers  


Categories