views:

58

answers:

1

Hey i am developing an iPhone app of a existing PhP mySQL website. i want to know, how to pull data from database and display on the phone? after going through several articles , i found out two ways..

1) create a web service, on server end, which will provide all the data in XML format to the device.

2) export php,mysql data in JSON format, and pass this JSON data to the device, which will parse it..

are these two correct approaches?? if yes, which is easier and faster?

+2  A: 

If you want to create a webservice from PHP to iPhone I suggest you to use JSON.
You can create a JSON response using json_encode (see manual here) and easily decode it on the device using SBJSon (you can download it here)

notme
thanks buddy...
devang
if you find this useful, can you accept it as answer? :)
notme