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
Explain me is multiple inheritance supported in php?
List types of array are available in php?
Can you use both this () and super () in a constructor?
Is php better than python?
How a variable is declared in php?
Tell me how to find the position of the first occurrence of a substring in a string?
How do I stop php artisan serve in windows?
Where sessions stored in PHP?
How to access standard error stream in PHP?
How to concatenate two strings together in php?
How to check whether a number is prime or not?
What is the use of Mbstring?
How does cookies work in php?
Does php support inheritance?
Explain some of the php string functions?