What is the difference between mysql_fetch_object and
mysql_fetch_array?
Answer Posted / ghan shyam
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
array.
you have to define array type in second parameter of mysql_fetch_array function.
fields will be accessible like
$result[name],$result[cust_name] (if type =MYSQL_ASSOC)
or like
$result[0],$result[1] (if type =MYSQL_NUM)
or like
$result[name],$result[cust_name],$result[0],$result[1] (if type=MYSQL_BOTH)
| Is This Answer Correct ? | 6 Yes | 5 No |
Post New Answer View All Answers
What is composer json?
Are php short tags acceptable to use?
What advance thing in php7?
Tell me what is the main difference between require() and require_once()?
Which cryptographic extension provide generation and verification of digital signatures?
Tell me when a conditional statement is ended with an endif?
How to create a session? How to remove data from a session?
What is the basic syntax of Php?
How do you remove duplicates from an array?
Write a program to display table of a number using php?
What beforeFilter() is used?
When use javascript vs php?
What are the correct and the most two common way to start and finish a PHP block of code?
What are the advantages of indexes?
What are the differences between require and include?