What is the difference between mysql_fetch_array and

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 the advantage of left outer join?

2 Answers  

What are the advantages and disadvantages of MySQL?

0 Answers   Satyam,

I want to insert userid of a customer,order time,etc in a table called ordermaster with orderid as primary key.Same time the product codes and required quantities (a1,2 and a2 4 and so on)inserted in another table orderdetails with same orderid reference.How the code will be in JSP using MySQL?

0 Answers  

1.how to fetch a value and Execute store procudure in mysql(INNODB) using phpMyAdmin? 2.can i wright a package in mysql database(INNODB)?

0 Answers  

mazimum size of a database in mysql? when we create a table then how many tables actually created? write there name?

1 Answers  

maximum size of a database in mysql?

2 Answers  

how to display only 4 records from a table based on a condition for ex i have a table called products in that nid,prodname are fields i want to display only any 4 records of perticular product plz tell me

6 Answers  

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

0 Answers  

How many tables will create when we create table, what are they?

2 Answers  

Please suggest me any course and institute which provide training on the below skills. • Knowledge of data extraction concepts and tools • QMF (query management facility)queries • Experience and expertise in QMF queries • Excellent ability to write, read, and interpret QMF queries against the Source Data Warehouse base level (daily and monthly) and month-end affinity comp tables • RDBMS & ER • Knowledge of Relational Databases (RDBMS) and Entity Relationship (ER) Diagrams • SOURCE Data Warehouse • Experience and expertise in Source Data Warehouse or data warehouses on the mainframe. • MS SQL Server • Experience in MS SQL Server • Excellent skill in writing/interpreting SQL queries and running Data Transformation Services (DTS) or open query packages. • Knowledge of writing/interpreting Visual Basic code.

1 Answers  

What is the difference between primary and unique key

5 Answers   CSC,

What?s the difference between query_cache_type 1 and 2?

1 Answers