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

Explain what is smarty?

1103


What are properties in php?

1015


Where is session id stored?

1021


Explain me differences between get and post methods?

1055


Write a php script to get the largest key in an array?

1077


What are classes in php?

1151


What is php dependency injection?

979


How to access a global variable inside a function?

1053


What is php default argument?

1077


What are the benefits of using php?

1069


What are magic methods?

1017


What is meant by pdo in php?

1055


What is the difference between null and empty?

1071


Tell me how to create a session? How to set a value in session? How to remove data from a session?

1068


What is the difference between the functions strstr() and stristr()?

1034