如何在iphone应用程序使用cocos2d中使用MYSQL数据库连接? [英] How can i use MYSQL database connection in iphone application useing cocos2d?
本文介绍了如何在iphone应用程序使用cocos2d中使用MYSQL数据库连接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发项目,我需要连接MYSQL数据库。我成功地连接SQLite在我的项目(使用cocos2d)。但我不能连接MYSQL数据库在我的项目。
我任何一个做这样比帮我如何连接。给我必要的信息。
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.
推荐答案
您将无法直接从iPhone连接到MySQL。
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.
因此,您必须
- iPhone使用HTTP发送请求到WebServer
- 连接到MySQL数据库的Web服务器
- Web服务器向iPhone返回数据(XML,纯文本)
- iPhone处理数据
- iPhone POSTING a request to the WebServer using HTTP
- Web Server connecting to the MySQL database
- Web Server returning data to the iPhone (XML, plain text)
- iPhone processing the data
b $ b
您可以使用此技术查询和插入/更新/删除数据。
You can use this technique to query and insert/update/delete data.
这篇关于如何在iphone应用程序使用cocos2d中使用MYSQL数据库连接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文