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

Is php coding easy?

578


What are the final class and final method?

634


How many days will it take to learn php?

624


What is the meaning of a persistent cookie?

629


Explain soundex() and metaphone().

660






How to block direct directory access in PHP?

633


Name some of the constants in php and their purpose.

620


> symbol is used to redirect the output of a command. State Whether True or False?

763


What is php destruct?

619


How to find the position of the first occurrence of a substring in a string?

604


What is the use of mvc in php?

613


How to strip whitespace (or other characters) from the beginning and end of a string?

544


Where can I learn php?

606


Is php procedural or oop?

645


Is apache needed for php?

577