Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why do we show php code in browser?

1114


What is a comment in php?

1128


What is substr() in php? And how it is used?

1102


How do I use isdigit function?

1116


How to invoke a user function?

1017


What is the best way to change the key without changing the value of a php array element?

1001


What is super keyword in c++?

1058


Tell me what does the array operator '===' means?

1201


Which parts of php are case sensitive?

969


What is good average session duration?

1076


What is the use of token in php?

1032


What is difference between mysql_fetch_array and mysql_fetch_assoc?

1008


Is it possible to destroy a cookie?

1037


Explain which cryptographic extension provide generation and verification of digital signatures?

1071


How do you clear environment variables?

993