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

Can you tell the difference between mysql_connect and mysql_pconnect? : Mysql dba

0 Answers  


What is mysql data directory? How to determine the location of the data directory?

0 Answers  


What is the difference between BLOB AND TEXT?

0 Answers  


Why MySQL is used?

0 Answers  


I have a table like this tblData (month int,Qty int) and i am inserting three rows in this table 1.tblData Values (1,100) 2.tblData Values (2,200) 3.tblData Values (3,300) The Result I want is the Running total of the field Qty that is 1 100 100 2 200 300 3 300 600 What is the Query for that ?

4 Answers  


How to create table show example

0 Answers  


How to include comments in sql statements?

0 Answers  


Can mysql and mariadb coexist?

0 Answers  


How do I edit a stored procedure in mysql?

0 Answers  


What is MySQL Stored Procedure?

1 Answers  


How to display top 50 rows?

0 Answers  


how to repair a table in mysql?

2 Answers  


Categories