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 csrf mvc?

510


What is difference between isset and empty in php?

542


How come the code works, but does not for two-dimensional array of mine?

508


Is java is better than php?

553


What are the encryption functions available in PHP?

571






What happens when submit button is clicked?

525


What is explode() in php?

545


How to define a function with any number of arguments?

572


Which function would you use to read a line of data from a file in php?

564


When use javascript vs php?

539


What changes I have to do in php.ini file for file uploading?

569


How to remove a file?

614


What are the different ways to login to a remote server?

485


What is namespaces in PHP?

554


So if md5() generates the most secure hash, why would you ever use the less secure crc32() and sha1()?

559