haisergeant
haisergeant

Reputation: 1111

Can I synchronize many records from sqlite database from iphone to mysql database on server

Currently I am developing an iPhone app with sqlite database, this database just has only one table with many records. And my server is using MySQL database. I would like to ask:

Can I send many records from sqlite database to MySQL database to update the table in MySQL database. Because I think I can do update with just one record. If you have a solution, please tell me detail how I can do that?

Any help would be appreciated.

Thanks.

Upvotes: 0

Views: 704

Answers (1)

John Franklin
John Franklin

Reputation: 4912

As I'm sure you've discovered, there is no built-in solution. There may be frameworks out there to help with it, but I'm unaware of any.

You're best bet is to use some well-known encoding like XML or JSON to transmit the records to the server using HTTP POST, and use Java or PHP or Ruby on Rails or whatever you're comfortable with to capture the record and write it to the database. Of course, once you've done that you need to consider security issues least some Black Hat write a simple perl script to fill your database to bursting with junk. You also need to be able to handle transmission failures and duplicate records. It is a lot of work.

XML parsing is built-in to iOS. JSON parsing can be added with the JSON iPhone framework. This are pieces to the puzzle, but there is still a lot left.

Upvotes: 2

Related Questions