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

What is composer json?

897


Are php short tags acceptable to use?

936


What advance thing in php7?

949


Tell me what is the main difference between require() and require_once()?

977


Which cryptographic extension provide generation and verification of digital signatures?

937


Tell me when a conditional statement is ended with an endif?

901


How to create a session? How to remove data from a session?

984


What is the basic syntax of Php?

1140


How do you remove duplicates from an array?

1044


Write a program to display table of a number using php?

933


What beforeFilter() is used?

1102


When use javascript vs php?

1008


What are the correct and the most two common way to start and finish a PHP block of code?

1052


What are the advantages of indexes?

905


What are the differences between require and include?

1003