What is the difference between mysql_fetch_array and
mysql_fetch_object?




Answers were Sorted based on User's Feedback



Answer / subrat

mysql_fetch_array ? Fetch a result row as an associative
ARRAY, a numeric array, or both
mysql_fetch_object ? Fetch a result row as an OBJECT

Is This Answer Correct ?    24 Yes 2 No

Answer / sumit

mysql_fetch_object : will return the results from database
as objects. fields will be accessible like an objects
i.e $result->name

mysql_fetch_array : will return the results from database as
array. fields will be accessible like in objects
i.e $result[name]

Is This Answer Correct ?    4 Yes 1 No

Answer / jeevabala

mysql_fetch_array : fetch the result as an array
mysql_fetch_object : fetch the result as a object

Is This Answer Correct ?    0 Yes 0 No




Answer / abhay kumar

mysql_fetch_array display all matching record from table as
an array while mysql_fetch_object dispaly first matching
from table as ab object

Is This Answer Correct ?    6 Yes 9 No

Post New Answer



More MySQL Interview Questions

what is JOIN? Give example & types of join?

13 Answers   Satyam, iMedia, Millennium, RAM Software,


Hi! I’m doing one Project in vb.net 2008 using mysql .In that Project have the following Issues.. 1.if one Employee getting Salary 1.2 lacs / annum means .. After he getting 1st month Salary i want to show remaining 11 month salary.. How can i Create Trigger for this Problem & How can i use it..

1 Answers  


What is the difference between a Table and a View?

3 Answers  


what is the Dynamic management views? where can you use?

1 Answers   ACC,


in a master-master replication with two masters and alternate slaves running on two systems.can i have a script or any mysql command to know which one is right now acting as master.

1 Answers  


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

3 Answers   ABC,


Please can the SQL code below be interpreted IF @xMatchCriteria='MATCH12' BEGIN IF EXISTS (Select * from #InsightData where (EmailAddress=@xDCPEmailAddress ) ) BEGIN SET @xTestMatchCriteria = @xMatchCriteria; SELECT @xCRMCustomerId=CustomerId, @xCRMDcpCustomerId=DcpCustomerId, @xCRMPortalCustomerID=PortalCustomerID,@xCRMDcpID=DcpID, @xCRMCardNumber=CardNumber, @xCRMEmailAddress=EmailAddress, @xCRMfirtLetterFirstName=firtLetterFirstName, @xCRMLastName=Surname,@xCRMAddressLine1=AddressLine1, @xCRMPostCode=PostCode FROM #InsightData where (EmailAddress=@xDCPEmailAddress ) END ELSE BEGIN SET @xTestMatchCriteria='No'+@xMatchCriteria; END END

0 Answers  


please give me the answer for this: query which generates the second highest integer in the table?

8 Answers  


What does myisamchk do?

1 Answers  


I have two sql database at different PC.how can link b/w database and database tables.

2 Answers  


write a c++ program to add a user to mysql.the user should be permitted to only "insert" into the given database

3 Answers   Infosys, Webyog,


How can you move the master database

0 Answers   IBM,




Categories