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 detect a mobile device using php

825


Is php class name case sensitive?

745


If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?

764


What are the uses of php language?

752


Write a program to get lcm of two numbers using php?

741


What is inheritance in php? How many types of inheritance supports php?

793


What are the differences between GET and POST methods?

762


Why does php start with variables?

792


Write a program to show the joining of two strings in php?

753


What is the best way to change the key without changing the value of a php array element?

768


Can we embedded directly PHP code into XHTML document? State Whether True or False?

1543


What is difference between post and put in rest?

758


What is php call function?

710


How to get the directory name out of a file path name?

750


Tell me how to execute an sql query? How to fetch its result?

787