What is the difference between mysql_fetch_object and
mysql_fetch_array?

Answer Posted / arumugam

mysql_fetch_object : will return the results from database
as objects. fields will be accessible like in objects
i.e $result->name,$result->cust_name

mysql_fetch_array : will return the results from database as
an array.The array will be in in associative as well as
numeric manner.
i.e $result['column_name'] or $result[0].here '0'indicates
first column in table

Is This Answer Correct ?    47 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between html and php?

509


How to replace a text in a string with another text in php?

522


How to create a session? How to remove data from a session?

525


What are the different loops in php?

546


What is the method to register a variable into a session?

491






What is cms php?

508


Write a php script to get the largest key in an array?

517


Why die is used in php?

564


How many escape sequences are recognized in single-quoted strings?

491


What is trait in php?

546


Is php 7 backwards compatible?

601


What is static method php?

555


How would you open a directory for reading in php?

574


What is the use of $_server and $_env?

573


What are the two types of variables?

530