3

I am new to iOS development. How to save data (say user information) over the network into central database? My application will take user information and store it into central database.

BenMorel
  • 34,448
  • 50
  • 182
  • 322
user849068
  • 33
  • 4
  • I've asked a similar question which may help you [here][1]. [1]: http://stackoverflow.com/questions/3943597/how-should-i-architect-my-iphone-app-to-talk-to-my-website – barfoon Jul 20 '11 at 17:09

1 Answers1

4

This is not a trivial 'the answer is this...' kind of questions.

For what it is worth, you would need to set up some form of server application - perhaps using a web MVC framework like Rails, Django, Grails, ASP.NET MVC - providing a nice RESTful interface to some backend database, passing data around in JSON documents.

Here is a reference to the iOS API end of things:

URL Loading System

Since you are using PHP - you might want to write a RESTful API for the database operations you require. A SO question about this is found here

And here is a tutorial describing how to create an API in PHP for an online leaderboard - which should get you started:

Online Leaderboard for iPhone game in PHP

Community
  • 1
  • 1
iandotkelly
  • 9,024
  • 8
  • 48
  • 67
  • He is correct... most choose to use a PHP script on your server that updates an MySQL database... at least I do. – Michael Morrison Jul 17 '11 at 21:40
  • Thanks for your quick reply.. My concern is i have a website. database is sql server database. now i want to make a iphone application which stores users data(information like name, city) into same database or i have to create another database? to do this is there any useful tutorial. i am concern like shall i use sqlite or core data etc. – user849068 Jul 17 '11 at 22:18
  • There's no reason why it can't go into the same database. Core data and sqlite (in this context) relates to client side storage, so the phone/pod/pad side. As for a tutorial - if you told me what technology the existing server side is written in, that could help. – iandotkelly Jul 17 '11 at 22:21
  • @iandotkelly- Central database is MySql. so i just want using application people can fill there details (that is easy) and those details then subbmit to central database. mysql in my case – user849068 Jul 17 '11 at 22:35
  • What technology is the website written in. – iandotkelly Jul 17 '11 at 22:42
  • PHP and MySql. with due respect to your question i think technology of website doesnot matter. what matter is central database and technology to use for transfer of data from iphone devices over the network.. – user849068 Jul 17 '11 at 22:48
  • No the website technology is critical here, you i'm not aware of a way to connect to a server side MySql database directly from iOS - the way most people do this is via a webservice - i.e. effectively via a website. So the iPhone hits the website with a specific URL - to retrieve or update records in the database. – iandotkelly Jul 17 '11 at 22:51
  • ok fine understood. so my application will hit the website. but how it will save data there? Can you please explain it more. Any tutorial or advice. n yah i really appriciate your replies. God Bless you – user849068 Jul 17 '11 at 22:55
  • I am not a PHP expert - so I've found and attached a link to a tutorial in my answer to your question. Good luck. – iandotkelly Jul 17 '11 at 23:00