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

Explain federated tables?

3 Answers   Tech Mahindra,


how to get only updated, deleted , inserted records after certain interval time in mysql with out using triggers...

0 Answers  


What is the difference between mysql_connect() and mysql_pconnect()?

7 Answers   TCS,


What is the difference between primary and unique key

5 Answers   CSC,


Can anyone help me to create a good mysql database schema with an example. Thanks, Sekar.jr

1 Answers  


what is the difference between MyIsam and InnoDb engine?

2 Answers  


how we connect the data base in any programme

2 Answers  


Which storage engines support transactions in MySQL?

2 Answers  


if we want to load data from a text file into a mysql table, but the columns in table are 1st: code(int) and 2nd: city(varchar), but in text file the format is 1st cityname and then code separeted by delimeters. how to load?

2 Answers  


what is JOIN? Give example & types of join?

14 Answers   Satyam, iMedia, Millennium, RAM Software,


What is the maximum length of a table name, a database name, or a field name in MySQL?

4 Answers  


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  




Categories