How can i use MYSQL database connection in iphone application useing cocos2d?

邮差的信 提交于 2020-02-01 04:55:47

问题


I am working on project and i need to connect MYSQL database. I am success to connect SQLite in my project ( using cocos2d).But i can not connect MYSQL database in my project. I any one do like this than help me for how to connect . Give me the necessary information.


回答1:


You will not be able to connect to MySQL directly from the iPhone. You must use some intermediate layer such as a Web application with PHP.

So, you will have something like this:

  1. iPhone POSTING a request to the WebServer using HTTP
  2. Web Server connecting to the MySQL database
  3. Web Server returning data to the iPhone (XML, plain text)
  4. iPhone processing the data

You can use this technique to query and insert/update/delete data.




回答2:


This site contains a libmysqlclient.a file compiled for the iphone (arm).

http://www.eval-art.com/2008/09/05/libmysqlclient-for-iphone-2/



来源:https://stackoverflow.com/questions/673300/how-can-i-use-mysql-database-connection-in-iphone-application-useing-cocos2d

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!