Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the difference between mysql_fetch_object and
mysql_fetch_array?

Answers were Sorted based on User's Feedback



What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / priya ranganathan

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

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




Is This Answer Correct ?    139 Yes 10 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / arumugam

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

mysql_fetch_array : will return the results from database as
an array.The array will be in in associative as well as
numeric manner.
i.e $result['column_name'] or $result[0].here '0'indicates
first column in table

Is This Answer Correct ?    47 Yes 4 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / arvind pippal

mysql_fetch_object will return an object by which we can
access the database fields records while mysql_fetch_aaray
return array of database records and return associative
array.

Is This Answer Correct ?    38 Yes 19 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / rupal

mysql_fetch_row ::Return row as aan enumrated array and each
line contain a unique ID .example.
$result=mysql_query($query);
while($row=mysql_fetch_row($result))
{
print $row[0] ;
print $row[1] ;
print $row[2] ;
}

mysql_fetch_array ::Return row as anassociative or an
enumrated array or both which is default .you can refer to
outputs as databases fieldname rather then number .example.
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
print $row['name'] ;
print $row['address'] ;
print $row['city'] ;
}

mysql_fetch_object :: it return as an object on the place of
array.

$result=mysql_query($query);
while($row=mysql_fetch_object($result))
{
print $row->name ;
print $row->address ;
print $row->city ;
}

Is This Answer Correct ?    18 Yes 1 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / shesh

mysql_fetch_object.....it return result as a object like
$result->name;
$result->city;

mysql_fetch_array.....it return result as a assiciative
array like
$result['name'];
$result['city'];

Is This Answer Correct ?    19 Yes 7 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / vinod

mysql_fetch_object : as an object, we can access value by
column name as properties of the object.

mysql_fetch_array : as an associative array, we can access
value by column name as like associative name as column name
from array

Is This Answer Correct ?    11 Yes 8 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / ghan shyam

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

mysql_fetch_array : will return the results from database as
array.
you have to define array type in second parameter of mysql_fetch_array function.

fields will be accessible like
$result[name],$result[cust_name] (if type =MYSQL_ASSOC)

or like
$result[0],$result[1] (if type =MYSQL_NUM)

or like
$result[name],$result[cust_name],$result[0],$result[1] (if type=MYSQL_BOTH)

Is This Answer Correct ?    6 Yes 5 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / shivang

yaar sabhi ek hi cheez keh rahein hain....mein aur kya post
karoon...i can only say......











same as above :P

Is This Answer Correct ?    12 Yes 12 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / bijaya.behera9911033016@orissa

mysql_fetch_object : as an object, we can access value by
column name as properties of the object.

mysql_fetch_array : as an associative array, we can access
value by column name as like associative name as column name
from array.

Is This Answer Correct ?    11 Yes 13 No

What is the difference between mysql_fetch_object and mysql_fetch_array?..

Answer / abhishek

my_fetch_object is only fetch the object value and
my_fetch_array is handle the arry but in associative form..
so this is the basic difference.

Is This Answer Correct ?    7 Yes 9 No

Post New Answer

More PHP Interview Questions

Explain me difference between mysql_connect and mysql_pconnect?

0 Answers  


How do you set the browser timeout?

3 Answers  


what method is used to generate a random number?

4 Answers  


hi,am a fresher in sap sd,will i try as a fresher or i wl go for with 2 to 3 yr exp,pls suggest me which web site is best for sap freshers.

0 Answers  


difference of move(), and copy() function in php?

3 Answers  


Which php framework is fastest?

0 Answers  


What are the rules to determine the “truth” of any value which is not already of the boolean type?

0 Answers  


What’s the difference between md5(), crc32() and sha1() crypto on PHP? -

2 Answers  


How to make multilanguage site in php? (like english,tamil)

2 Answers  


What are the three classes of errors that can occur in php?

0 Answers  


Please explain is it possible to use com component in php?

0 Answers  


Does winrunner 8.0 or qtp 8.0 supports php

2 Answers  


Categories