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 / srinivas1982

sorry for my mistake. here is the answer
the functions mysql_fetch_row(), mysql_fetch_array() and
mysql_fetch_object() return one row from the result, and
then move the pointer on. If there are no more rows to
fetch, it returns false. This means you can you use a very
simple while loop:

$result=mysql_query("SELECT * FROM sometable");
while($row=mysql_fetch_row($result)){
do_something_with_row();
}

This will automatically terminate when the last row has been
processed.

the difference between mysql_fetch_row() and
mysql_fetch_array() is that the first returns the results in
a numeric array ($row[0], $row[1] etc), while the latter
returns a the results an array containing both numeric and
associative keys ($row["name"], $row["email"] etc).
mysql_fetch_object() returns an object ($row->name,
$row->email etc).

Is This Answer Correct ?    60 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How send email in php?

932


How does csrf token work?

969


What good is polymorphism?

894


Explain how you can update memcached when you make changes to php?

1051


How can you pass a variable by reference?

951


Can you explain, when to use if-else if-else over switch statements?

964


What is the difference server side and browser side validation?

945


Is php still used?

914


What is include in php?

907


What is the difference between single-quoted and double-quoted strings in php?

1013


What is php crud api?

913


What is $_ files in php?

1044


Can we use session in mvc?

948


What is the role of the .htaccess file in php?

908


What is the major php security hole? How to avoid?

942