如何从iPhone连接到MySQL数据库? [英] How to connect to a MySQL database from an iPhone?

查看:207
本文介绍了如何从iPhone连接到MySQL数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从iPhone连接到远程mysql数据库。我搜索了很多网站,但我没有找到任何帮助。

I am trying to connect to a remote mysql database from an iPhone. I have searched many web sites but I did not find any help. If anyone has worked with this please send a solution.

推荐答案

假设你有一些服务器端编程的经验Rails),你可以从一个URL的内容创建一个NSArray,在那里建立到MySQL服务器的连接,并以ASCII或XML格式打印你想要的结果。

Assuming you have some experience with server-side programming (like PHP or Rails), you could just create an NSArray from the content of a URL where you establish a connection to the MySQL server and print the results you want in ASCII or XML format.

NSURL *myURL = [NSURL URLWithString:@"http://www.myserver.com/results.php"];
NSArray *sqlResults = [[NSArray alloc] initWithContentsOfURL:myURL];

也有助于您格式化服务器页面打印的结果:
http://developer.apple.com/iphone/library /documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html

Also useful to help you format the results printed by the server page: http://developer.apple.com/iphone/library/documentation/Cocoa/Conceptual/PropertyLists/Introduction/Introduction.html

这篇关于如何从iPhone连接到MySQL数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆