what is the difference between mysql_fetch_array() and
mysql_fetch_row()?
Answers were Sorted based on User's Feedback
Answer / guru
Mysql_fetch_array():
Mysql_fetch_array() returns row as an associative, numeric array or both based on parameters passed in it. Three types of parameters can be passed in mysql_fetch_array function.
1. MYSQL_BOTH - return both associative and numeric array
2. MYSQL_ASSOC - return associative array
3. MYSQL_NUM - return numeric array
Reference:http://www.phponwebsites.com/2014/03/php-mysql-fetch-array.html
Mysql_fetch_row():
It return row as numeric array. We can't use associative indices to retrieve data from mysql table using php.
Reference: http://www.phponwebsites.com/2014/03/php-mysql-fetch-row.html
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / tushal burungale
fetch_array:
fetch_array returns result in assoc array and also in
numeric array
e.g fetch_array:Array([0]=>Tushal)
fetch_row:
mysql_fetch_row returns result in numeric array only.
e.g
fetch_row:Array([0]=>Tushal[name]=>Tushal)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / narasimha.p
mysql_fetch_array()works as an associative array i.e. just
use the field name specified in your database to access the
values while mysql_fetch_row() returns the value of a
single field in a particular row if you r going to specify
the array's index which starts from '0'.
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / aditya
sql_database
singsingle field in a particular row if you r going to specifyle field in a particular row if you r going to specify
is it correct answer????????????????????
| Is This Answer Correct ? | 0 Yes | 1 No |
Answer / manikandan
mysql_fetch_array()works as an associative array i.e. just
use the field name specified in your database to access the
values while mysql_fetch_row() returns the value of a
single field in a particular row if you r going to specify
the array's index which starts from '0'.
| Is This Answer Correct ? | 4 Yes | 6 No |
Answer / jemit p jose
mysql_fetch_row() for select aggragate data or single data
eg:select count(*) from TableName
mysql_fetch_array() for retrive more data from Table
| Is This Answer Correct ? | 42 Yes | 53 No |
Answer / srinivas1982
Wrong mysql_fetch_row retrives a single row or record from a
table and mysql_fetch_array returns all rows and result into
an array this array is both numeric and associative.
mysql_fetch_row has single row.
where as mysql_fetch_array has multiple rows.
| Is This Answer Correct ? | 25 Yes | 42 No |
How to create connection in php?
Explain Traits in PHP?
how to do connectivity of 2 dbs in PHP script?
How do you check if a variable has not been set in php?
How to compare two strings with comparison operators in php?
Is python better than php?
how can we retrive value from one database server and store them another database server using php?
Hello I m 1.5 exp, i want code : ms word to Html in php,retrieve the words in ms word in to dispaly browser in (same format,alignment). pls help me everybody Regards selva
Tell me how can we check the value of a given variable is alphanumeric?
What are the difference between overloading and overriding in oops?
What are the features of php?
hello all, I need some sample placement papers in lion bridge.. can anyone help me?