what is the difference between mysql_fetch_array() and
mysql_fetch_row()?
Answer Posted / piyush patel
mysql_fetch_array:
This function return row as an associative array, a numeric
array, or both. you can refer to outputs as databases
fieldname rather then number.
example :
$result=mysql_query($query);
while($row=mysql_fetch_array($result))
{
print "$row['name']";
print "$row['mobile']";
}
mysql_fetch_row :
This function return row as an enumrated array and each row
contain a unique ID.
example:
$result=mysql_query($query);
while($row=mysql_fetch_row($result))
{
print "$row[0]";
print "$row[1]";
print "$row[2]";
}
Is This Answer Correct ? | 30 Yes | 12 No |
Post New Answer View All Answers
What is the main difference between require() and include()?
What exactly is validating and sanitizing?
Why do we need abstract class in php?
What does the scope of variables mean?
What are the different ways to login to a remote server?
Explain php parameterized functions.
Explain the difference between urlencode and urldecode?
Is strcmp case sensitive?
Do you know what is use of count() function in php?
What are the differences between mysqli_connect and mysqli_pconnect?
How can we display information of a variable and readable by a human with php?
What are the differences between PHP3 and PHP4 and PHP5? what is the current stable version of PHP?
What is regular expression in javascript?
How arrays are used in php?
How can we create a database using php?