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 we set session value in javascript?
Tell me how can I display text with a php script?
Why do we need session?
In PHP, fgets() is used to read a file one line at a time. State Whether True or False?
Explain difference between urlencode and urldecode?
How easy is php?
Does session expire on closing browser?
What is difference between session and cookies in php?
How long does a php session last for?
How can you pass a variable by reference?
What is crypt () in php?
What are the delimiters in php?
Is php closing tag necessary?
How many data types are used by php?
How to get no. of rows using MYSQL function?