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...

Which is the best method to fetch the data from mysql?
1.mysql_fetch_array()
2.mysql_fetch_object()
3.mysql_fetch_row()
4.mysql_fetch_assoc()

Answer Posted / mervin thomas

I think all mysql_fetch_array() is the best one, since we
can get the value of the records using the numeric index (as
numbers) or using the string index (as column).
mysql_fetch_array () => fetches the records using the two
way index method,
(ex). $record[0];
$record['id'];
gives the same value.

mysql_fetch_row() fetches the records using the numerical index
ex. $record[0];

mysql_fetch_assoc() fetches the records using the string
index and returs the records as associative array
ex. $record['id'];

mysql_fetch_object() fetches the records as the object.
ex. $record->id;

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we enable error reporting in php?

1088


Where php basically used?

1057


write a prog using insert,update,delete in this manner as output? name: phno. add button 1.name phno. edit button delete button 2.

2064


Why laravel is the best php framework in 2019?

995


Explain me what is the w3c?

1194


How check variable is set or not in php?

938


How error handling is being handled by php?

1101


Can a super () and this () keywords be in same constructor?

967


Why triggers are used in mysql?

1026


What are global variables in php?

1000


Which character is used to match exactly one character?

1052


How to call a php function from another php file?

1027


How easy is php?

994


What is the interface in php?

1092


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

1211