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 difference between mysql_connect and mysqli_connect?
How do I update php?
What is artisan in php?
What is the use of addslashes in php?
in PHP for pdf which library used?
What is difference between get and post in php?
Is php the same as html?
What is regex in html?
Tell me how stop the execution of a php scrip?
How can we check the value of a given variable is a number?
What is properties of class?
What is chrome logger?
What is the difference between explode () and split () functions in php?
What are the three parts of an http request?
Tell me is it possible to remove the html tags from data?