What are the differences between MySQL_fetch_array(),
MySQL_fetch_object(), MySQL_fetch_row()?
Answers were Sorted based on User's Feedback
Answer / amita
mysql_fetch_object will return result from database as
objects i.e. $result->name
mysql_fetch_array will fetch result row as an associative
array or numeric array or both with the help of mysql_NUM or
mysql_ASSOC option.
eg: $result[0] ,$result['name']
mysql_fetch_row will fetch result row as an numeric array.
eg: $result[0]
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vel
when u r using mysql_fetch_object i will first matching
record.
u can access the result set by column name of that record.
when u r using mysql_fetch_array i will fetch all the
matching records from the table.
u can access the result set by index as well as colum name
of that record.
| Is This Answer Correct ? | 3 Yes | 0 No |
How can we get total number of records by query in mysql?
What is difference between inner vs self vs cross?
How to create trigger in mysql phpmyadmin?
How to make a copy values from one column to another in mysql?
How many queries can mysql handle?
What is the use of mysql_fetch_array () function in php?
What is the purpose of using timestamp data type?
Fname Lname City Pin ramesh kumar salem 365241 Query to generate a code having the firstletter of Fname,Lname & 3letter of city Last 3letter of pin,all in capital letters
What is mysqli_num?
What is pragma serially_reusable and why is it used?
ru compare the 2 null values?
How to convert dates to character strings?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)