what is the difference between mysql_fetch_array() and
mysql_fetch_row()?
Answer Posted / sekhar
mysql_fetch_array($resultset, [return type]);
return a row from the result set as an array
return type values:
MYSQL_NUM If return type is mysql_num, we have to use the
column position in the result set.
MYSQL_ASSOC: if return type is mysql_assoc, we have to fetch
the data by using column names in result set.
MYSQL_BOTH: if return type is mysql_both, we have to fetch
the data by using column index or column names in the result
set.
mysql_fetch_rows($resultset);
retrives the row from the result set and move the pointer to
the next record.
we have to retrive the data from the row by using the filed
position in the result set.
mysql_fetch_assoc($resultset);
retrives a row from the resultset as an associative array.
we have to retrive the data by using the columns name in the
result set.
mysql_fetch_object($resultset);
return the row as an object. we have to fetch the data in
the row fetch the column names in the result set as $row->
column name in the result set.
| Is This Answer Correct ? | 11 Yes | 10 No |
Post New Answer View All Answers
How to write in a file in php?
Does php have future?
How many open modes available when a file open in PHP?
What is static in php?
Which function is used in php to count the total number of rows returned by any query?
What is use of mysqli_query in php?
How do you find the length of a string in php?
what is the current salary package in India for a PHP programmer who has 1.5 years experience
How does php server work?
What is php default argument?
How to check a key exist in an array?
What is the latest version of php?
What is session and why do we use it?
Is php still in demand?
Explain Booleans in PHP?