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

What are the characteristics of php variables?

763


What are some new features introduced in php7?

8581


How to connect to a url in php?

715


How to remove leading and trailing spaces from user input values?

764


What is the use of explode() function?

828


What is psr in php?

816


Can we run php on tomcat server?

792


What is session management php?

796


How escape single quotes php?

706


Which of the data type is compound datatype supported by PHP?

783


What does pear stand for?

726


Write down the code for save an uploaded file using php?

647


Explain the difference between $var and $$var?

710


Is php a low level language?

728


Which is the correct way to check if a session has already been started ?

761