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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I use php in html?

922


Explain me what are the main error types in php and how do they differ?

932


What is Mcrypt used for?

941


Is php object oriented?

863


What is move_uploaded_file in php?

915


What is php oop?

949


Do you know design patterns. List few?

905


What is chrome logger?

917


Explain how is it possible to cast types in php?

926


What is mysqli_real_escape_string?

947


Which is faster for or foreach php?

892


Is facebook still written in php?

924


What does $_cookie means?

917


What are magic constants in php?

1012


Are static variables final?

956