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

Which is the best method to fetch the data from mysql?
1.mysql_fetch_array()
2.mysql_fetch_object()
3.mysql_fetch_row()
4.mysql_fetch_assoc()

Answer Posted / mervin thomas

I think all mysql_fetch_array() is the best one, since we
can get the value of the records using the numeric index (as
numbers) or using the string index (as column).
mysql_fetch_array () => fetches the records using the two
way index method,
(ex). $record[0];
$record['id'];
gives the same value.

mysql_fetch_row() fetches the records using the numerical index
ex. $record[0];

mysql_fetch_assoc() fetches the records using the string
index and returs the records as associative array
ex. $record['id'];

mysql_fetch_object() fetches the records as the object.
ex. $record->id;

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer

1907


Which framework is best for php?

956


How to get the ip address of the client?

9169


What is the meaning of ‘escaping to php’?

1081


How can we determine whether a php variable is an instantiated object of a certain class?

943


How to get elements in reverse order of an array in php?

1014


Explain me difference between mysql_connect and mysql_pconnect?

950


What is cookies php?

948


What is mod_php?

1000


Write a program to find the factorial of a number in php?

988


What u mean by query?

1028


Does https prevent csrf?

903


What types of MYSQL function available for affecting columns

942


What is a trait in php?

1004


What are the different types of statements that are present in php?

999