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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why session is required?

711


How do I see how many pages per session in google analytics?

720


Tell me what are the correct and the most two common way to start and finish a php block of code?

719


Starting or restarting a computer is called

785


Explain about looping in PHP?

825


Why do we use htaccess and where?

742


What is a collection in php?

681


Explain the difference between php4 and php5.

738


Is facebook still written in php?

747


What is meant by an associative array?

728


What is csrf verification?

725


What does the unset() function mean?

797


What is a php web application?

730


Are php session secure?

763


Is it possible to protect special characters in a query string?

762