Saving JSON table to Sqlite database on a server.

Hello All,

First, I want to thank you in advance for any advice you can give me. What I want to do is take a JSON table that has been manipulated by the user and save it to a pre-existing Sqlite database located on a network. So to break it down a bit the user would hit a button and all the data that was saved would be added to a specific already existing database on the server. I have no idea where to begin for this and I think that’s my biggest problem. If anyone had any advice big or small that would be greatly appreciated.

Thank you!

-B

Hi, you’ll probably want to take a look at network.request which is typically used for this.

The json is transferred in the body if using SOAP

Sounds like you already have your own server but if not there are services ot there that make it easy.

App42 from shephertz can do this for you very easily, come with corona lua syntax, and has basic free service.

You can store this as noSQL, mongo for example, but also mySQL and msSQL can store json files.

If thats youre only purpose then maybe noSQL is easier/more justified.

I’d need more specifics from you to give a more specific reply.

Generally speaking, I would use network.request() and pass key/value pairs (which could include your json table), and transmit it to a web script (php, .net, etc.). That script can then scrub the data to avoid SQL injection attacks, etc. and then put it into whatever database PHP (or your script language of choice) supports.

Corona’s network.request() works better with RESTful based scripts. SOAP requires a bunch of XML and some handshaking where REST pretty much just uses straight up HTTP GET/POST/PUT/DELETE type requests and can handle most authentication scheme’s used by HTTP (Basic Authentication for example)

Rob

Have you checked out Skytables in the marketplace?  

https://marketplace.coronalabs.com/plugin/coronium-skytable

It’s great for doing a dump to a server. 

The Digital Ocean service at $10 a month is quite reasonable, and Scotts documentation had it all up and running easily.

Using the skytable was a breeze and before that, the PHP solution was a bit of a blur…

Thanks for pointing out Coronium SkyTable @graham07. You can actually run it on a $5 a month box as well. Also, that was developed by myself and not Scott (not that it matters).  :wink:

-dev

Oops  :blink: I knew that too  :rolleyes: Apologies,  It was late  :ph34r: - that’s my excuse and I’m sticking to it…

Develephant’s AWESOME documentation had it up and running easily 

Thanks everyone so much for your help. I will definitely take a look at these options. I should have been a bit more clear but the server would (if possible) be a local server on a local network. Would this change any of your suggestions? 

Hi, you’ll probably want to take a look at network.request which is typically used for this.

The json is transferred in the body if using SOAP

Sounds like you already have your own server but if not there are services ot there that make it easy.

App42 from shephertz can do this for you very easily, come with corona lua syntax, and has basic free service.

You can store this as noSQL, mongo for example, but also mySQL and msSQL can store json files.

If thats youre only purpose then maybe noSQL is easier/more justified.

I’d need more specifics from you to give a more specific reply.

Generally speaking, I would use network.request() and pass key/value pairs (which could include your json table), and transmit it to a web script (php, .net, etc.). That script can then scrub the data to avoid SQL injection attacks, etc. and then put it into whatever database PHP (or your script language of choice) supports.

Corona’s network.request() works better with RESTful based scripts. SOAP requires a bunch of XML and some handshaking where REST pretty much just uses straight up HTTP GET/POST/PUT/DELETE type requests and can handle most authentication scheme’s used by HTTP (Basic Authentication for example)

Rob

Have you checked out Skytables in the marketplace?  

https://marketplace.coronalabs.com/plugin/coronium-skytable

It’s great for doing a dump to a server. 

The Digital Ocean service at $10 a month is quite reasonable, and Scotts documentation had it all up and running easily.

Using the skytable was a breeze and before that, the PHP solution was a bit of a blur…

Thanks for pointing out Coronium SkyTable @graham07. You can actually run it on a $5 a month box as well. Also, that was developed by myself and not Scott (not that it matters).  :wink:

-dev

Oops  :blink: I knew that too  :rolleyes: Apologies,  It was late  :ph34r: - that’s my excuse and I’m sticking to it…

Develephant’s AWESOME documentation had it up and running easily 

Thanks everyone so much for your help. I will definitely take a look at these options. I should have been a bit more clear but the server would (if possible) be a local server on a local network. Would this change any of your suggestions?