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
Can I use php in html?
Explain me what are the main error types in php and how do they differ?
What is Mcrypt used for?
Is php object oriented?
What is move_uploaded_file in php?
What is php oop?
Do you know design patterns. List few?
What is chrome logger?
Explain how is it possible to cast types in php?
What is mysqli_real_escape_string?
Which is faster for or foreach php?
Is facebook still written in php?
What does $_cookie means?
What are magic constants in php?
Are static variables final?