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
iam mca post graduate in 2010 not getting job in JAVA so iam looking for carear in php as market demand is high so it is best option to try for php or not
When sessions ends?
Explain me how failures in execution are handled with include() and require() functions?
What is default session time in php?
Is null or empty c#?
What does trim () do in javascript?
What is polymorphism in php?
How can we change the maximum size of the files to be uploaded?
What is if isset ($_ post submit )) in php?
Why session timeout is important?
How to create a text file in PHP?
How to calculate the length of a string?
What is the difference between $name and $$name?
What is php compared to html?
Which character is used to match exactly one character?