How to sync value from sqlite database and save to webserver in iphone
i have sqlite database and table
name is journey
i am trying from two days but did't get it on.
i want take value from sqlite database and save to webserver database table on button click i want fetch data value from localdatabase and save to webserver database how can i do this please help m开发者_高级运维e how to do or hints to solve that for this it very vital for me. thank in advance
I have developed such application which communicates with live database.
For that, you should follow below process:
1) Fetch data from your local database. (like sqlite)
2) Then for uploading data, you should create web-service on your server which will get parameter as XML file and store data in server database.
3) Then you have to create XML file of data which you have got from local database.
4) Implement POST web-service and pass XML file to your server web-service. (XML based web-service).
5) So, server web-service will parse the entire XML file which came from iPhone app and add data to live database on server. Then it will return some message like success or fail to live database.
6) Based on that, you can display message to iPhone app.
There are the steps which will help you to interact with your live database and upload data from iPhone app to server database.
Let me know in case of any difficulty.
Cheers.
You did not write what kind of database you have on your web server, but I suppose you have some kind of relational database and then you need some sort of web service in between that you can send data to from your iPhone app in some format, for example XML or JSON. You could for example create a RESTful web service on your server and use RESTKit to communicate with it from your iPhone.
To sync the local database with the server, we should write a webservice. we will be passing the values from local db to server db using this webservice. we can send data to server and receive data from server in XML format. Values are retrieved by parsing the XML.
Web-service can be written using php or ASP etc.
精彩评论