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 are the difference between overloading and overriding in oops?
Can php replace javascript?
What is use of header() function in php?
How to join multiple strings into a single string?
What is mysqli_fetch_array?
What is an array in php?
What software is required to run php?
Does mysql need php?
What is the difference between php 5 and php 7?
How can you make a connection with mysql server using php?
Which PHP function would you use to send an email?
How do I make a reset button in html?
What is a php certification?
Why php is used in html?
How to convert one date format into another in php?