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?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between array_pop() and array_push()?

1226


How to check a variable is array or not in php?

1024


What are the ways to include file in php?

998


Is overloading possible in php?

978


Why php is also called as scripting language?

968


How to execute a function in php?

949


Tell me how is it possible to remove escape characters from a string?

958


What is the use of print_r function in php?

944


How to call a php function from another php file?

983


Tell me what is the actually used php version?

1031


Tell me how a constant is defined in a php script?

940


Why do we use htaccess and where?

1018


If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?

962


What is the Pipe Symbol represented?

1101


What is split function in php?

973