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

How to delete a file from the system?

570


Will php die?

524


What is the use of mvc in php?

512


What is full form of PHP?

609


What's the difference between __sleep and __wakeup?

546






What is the different between count() and sizeof() in php?

516


How many types of php are there?

518


What is final class and final method in php?

551


What is regex in html?

510


Why session timeout is important?

621


What is session_register()?

556


How do you end a session in php?

552


What is magic quotes?

600


What is singleton class in php?

535


Does jwt protect against csrf?

483