What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?

Submitted by: Administrator
Answer 1:
mysql_fetch_array() -> Fetch a result row as a combination of associative array and regular array.
mysql_fetch_object() -> Fetch a result row as an object.
mysql_fetch_row() -> Fetch a result set as a regular array().


Answer 2:
The difference between mysql_fetch_row() and mysql_fetch_array() is that the first returns the results in a numeric array ($row[0], $row[1], etc.), while the latter returns a the results an array containing both numeric and associative keys ($row['name'], $row['email'], etc.). mysql_fetch_object() returns an object ($row->name, $row->email, etc.).
Submitted by: Administrator

Read Online PHP Job Interview Questions And Answers