Which is the best method to fetch the data from mysql?
1.mysql_fetch_array()
2.mysql_fetch_object()
3.mysql_fetch_row()
4.mysql_fetch_assoc()
Answer Posted / mervin thomas
I think all mysql_fetch_array() is the best one, since we
can get the value of the records using the numeric index (as
numbers) or using the string index (as column).
mysql_fetch_array () => fetches the records using the two
way index method,
(ex). $record[0];
$record['id'];
gives the same value.
mysql_fetch_row() fetches the records using the numerical index
ex. $record[0];
mysql_fetch_assoc() fetches the records using the string
index and returs the records as associative array
ex. $record['id'];
mysql_fetch_object() fetches the records as the object.
ex. $record->id;
| Is This Answer Correct ? | 13 Yes | 1 No |
Post New Answer View All Answers
if you run the app program all vendor open items are cleared but is it possible to reverse the again again open items please tell me the answer
Which framework is best for php?
How to get the ip address of the client?
What is the meaning of ‘escaping to php’?
How can we determine whether a php variable is an instantiated object of a certain class?
How to get elements in reverse order of an array in php?
Explain me difference between mysql_connect and mysql_pconnect?
What is cookies php?
What is mod_php?
Write a program to find the factorial of a number in php?
What u mean by query?
Does https prevent csrf?
What types of MYSQL function available for affecting columns
What is a trait in php?
What are the different types of statements that are present in php?