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()

Answers were Sorted based on User's Feedback



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

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

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

Answer / pratik

mysql_fetch_object() is the best method. It is not
generally affected in small result. mysql_fetch_array() has
some limit to fetch data from table. when result it too high
(more than 4000 record) at that time
mysql_fetch_object()will support.

Is This Answer Correct ?    8 Yes 0 No

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

Answer / 24/06/08

mysql_fetch_array() is select total values of tables.
mysql_fetch_object() is select a partcular name of the row
in a tables.
mysql_fetch_row() is select row in tables is saem one
object functionor comment.
mysql_fetch)assoc() it means the same function of
mysql_fetch)row and object function.

Is This Answer Correct ?    7 Yes 5 No

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

Answer / pradeep

hi all,

i think mysql_fetch_object or mysql_fetch_array both are best method bcz both are take same time for result show.

but mysql_fetch_array() fetches the records using the numeric index (as numbers) or using the string index (as column)

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

Is This Answer Correct ?    0 Yes 0 No

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

Answer / devendra modi

mysql_fetch_object() is better then mysql_fetch_array()
because mysql_fetch_array () will return numeric and
associative array if you have 1 lac record then it will
generate two array mean load two lack record. so it is
slower then mysql_fetch_object()

Is This Answer Correct ?    0 Yes 0 No

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

Answer / vinoth

My Opinion is at the developer point of view
mysql_fetch_assoc() is the Best method to fetch data but at
the same time at the user point of view we can use
mysql_fetch_object()for faster execution of the data.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

What percentage of websites use php?

0 Answers  


What library is used for pdf in php?

0 Answers  


How do you develop your own PHP extension ?

2 Answers  


Is it more secure to use cookies to transfer session ids?

0 Answers  


Is empty check in php?

0 Answers  


What is the difference between print() and echo() in PHP?

0 Answers  


What is a trait in php?

0 Answers  


How can we find the number of rows in a result set using PHP?

2 Answers  


How to protect special characters in query string?

0 Answers  


Tell me what is pear?

0 Answers  


Tell me what is the main difference between php 4 and php 5?

0 Answers  


Which php framework is fastest?

0 Answers  


Categories