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
Where are php configuration settings stored?
How to take a substring from a given string?
What is php trait?
Tell me how can we connect to a mysql database from a php script?
What library is used for pdf in php?
Does wordpress still use php?
How to submit form without a submit button.
What are the difference between abstract class and interface in oops?
What is php dependency injection?
Whether it is possible to share a single instance of a memcache between multiple php projects?
Is php a web server?
Does php need html?
What are static variables in php?
Is php still relevant 2019?
Who created numbers?