Saving data to a mySQL database

First time here, sorry if the scenario is so stupid. I currently have a community site where people can share places interesting to be visited. All the data is saved in a MySQL database online. I am planning to develop an iPhone app to allow people take pictures/get coordinates in the sites. If they are online, info will be saved directly in the site’s database. If offline, it should be saved locally and synch later. Questions are:

  • is there a way to save the info directly in the online database?
  • is there a way to synch the local data (SQL Lite or text file) with the online database?

Thanks a lot,
Alex [import]uid: 4883 topic_id: 492 reply_id: 300492[/import]

Alex,

I am not currently developing with Corona but it sounds to me like this should be doable. If you have your data online in a mySQL database alraedy, your iPhone app would merely need to detect if a connection can be made, and if so, pull the relevant data from your database using LuaSockets (http, hitting a SOAP service maybe? ), and then comparing/synching to a local file, likely an XML file?

And vice versa, once connected you would want to take the local file and upload any new changes to the online mySQL database. Most likely you would have some sort of mechanism to denote that a record needs updating to minimize the amount of data needing to be transferred.

Hopefully someone with some more knowledge specific to Corona can help you out but I thought I would share my thoughts…

Gary
[import]uid: 4915 topic_id: 492 reply_id: 989[/import]

Actually I am very interested in this question. Can Corona built app access MySQL directly instead of using SQLite? This is one of my evaluation criterion. If this ends up being a system limitation then what is the alternative? [import]uid: 2949 topic_id: 492 reply_id: 6836[/import]

What does “access MySQL directly” actually mean? Open a socket to the MySQL server and actually run commands on it? Or access stored data via a web based xmlrpc/soap/rest connection?

Both are technically possible, though I would think that the direct mysql connection wouldn’t be that great an idea (atleast from a security perspective).

This app ( http://github.com/gg-ansca/ATA ) is doing cached views of xml data that’s pulled down from a wordpress generated feed, which should give you something of an idea about where to start.

[import]uid: 3 topic_id: 492 reply_id: 6931[/import]

All good advice…I will check out the sample app. thanks for sharing. [import]uid: 2949 topic_id: 492 reply_id: 7200[/import]