开发者

How to send/store data from iphone to mysql database and display the results on webpage

basically I have an application which records the user's locations(the longitude and longitude) using corelocation and stores the data to a core data model. I wish to know how I can use an UIbutton to send that location data to a local MYSQL database and display the results on a webpage using php maybe?

I'm not quite sure how to do the php scripts etc, any help, tuts or ex开发者_运维百科amples would be much appreciated!


I don't know iPhone at all but I was implementing an Android app that did the same thing - record GPS coords and send them to the webserver.

It was all done through SOAP webservices - from Android (Your iPhone) connect to the webservice, choose proper method and use it to send the data to the webservice. The webservice (that has to be written) then gets the data, parses it and stores to the database so the data could be presented on the webpage...

You also can use REST webservices that are simpler to implement and also the comunication with it is simpler.


I think the answer should be split in 2 -

Sending the data to the server:

You can open direct TCP connections like discussed here Connecting iPhone to an ODBC Database and here http://www.iphonedevsdk.com/forum/iphone-sdk-development/3942-retrieve-information-sql-server.html

And you can do as @Jhaliya suggested and utilize some web service or REST API. I used Web Services (which I understand are a losing horse), but with this site - http://sudzc.com - it was incredibly easy to utilize. You just give the description of the web service, and get objective-c classes to use (wrapping behing the scenes encoding, sending,receiving,decoding etc.).

Showing the data:

There are several free platforms for PHP showing graphs for a database. Some of them have better GUI, some have support for a minimal mobile UI, and more. I happened to use:

Art - http://art.sourceforge.net/

Jasper Reports - http://jasperforge.org/projects/jasperreports

And I'm sure there's more... You can search for "sql web reporting" and perhaps add "open source"...

HTH!

Oded

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜