In how many ways we can retrieve the date in the result set
of mysql using PHP?

Answer Posted / binoyav

1) mysql_result: returns the value of a field in a recordset.
Note: This function is slower than mysql_fetch_row(), mysql_fetch_array(), mysql_fetch_assoc() and mysql_fetch_object()
2) mysql_fetch_array(): function returns a row from a recordset as an associative array and/or a numeric array. Note: Its a misconception that, this function will return all rows. Its completely wrong, it will return only a single row at a time as like mysql_fetch_row
3) mysql_fetch_row(): returns a row from a recordset as a numeric array
4) mysql_fetch_assoc(): returns a row from a recordset as an associative array. No numerical indices available for this
5) mysql_fetch_object(): returns a row from a recordset as an object

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is member variable?

740


What is prepare in php?

754


How do I check environment variables?

755


Why we use get in php?

746


Explain php explode() function.

772


How do you parse and process html/xml in php?

749


What is a php 5?

741


Can constructor be private in php?

752


What are the popular frameworks in php?

706


List types of array are available in php?

754


What's the best method for sanitizing user input with php?

690


How to remove an empty directory?

800


How to check a key exist in an array?

787


How to break a file path name into parts?

735


Explain about switch statement in PHP?

787