-2

I have made a web application in php and mysql. Now I got the responsibility to make an API so that the data will be transferred from the server to iphone. I have no idea for that. Please guide me how to process.

Thanks on advance.

Srim
  • 527
  • 2
  • 8
  • 23

2 Answers2

0

You will need to create a web service that will respond to requests coming from the app with data from your database. You'll find more info here http://net.tutsplus.com/tutorials/php/creating-an-api-centric-web-application/

slash197
  • 9,028
  • 6
  • 41
  • 70
0

You can create a REST API in PHP. The iphone app can call this web service. The web service can respond to the request in json format. It is pretty easy.

Pramod Sivadas
  • 873
  • 2
  • 9
  • 28
  • You can easly create response in XML or JSON format. For XML response you have to build the XML. and serve that XML. – Pramod Sivadas Mar 29 '12 at 07:58
  • suppose I am trying to log in iphone. so how it will be checked for the login credential which have already be saved in mysql database. How the user input username and password will be checked? For that what are the necessary steps, please tell me. – Srim Mar 29 '12 at 09:35
  • 1
    you have to create a web service for login, Where u accept user name and password. If the authentication is successful you have to generate a unique token for that user and send it as response. The token must be saved in DB. The user have to pass this token for any further requests from iphone side. – Pramod Sivadas Mar 29 '12 at 10:11