devang
devang

Reputation: 113

fetching data on the iphone

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?

Upvotes: 0

Views: 315

Answers (1)

pasine
pasine

Reputation: 11543

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)

Upvotes: 2

Related Questions