Objective-C中的MySQL命令 [英] MySQL Command in Objective-C

查看:72
本文介绍了Objective-C中的MySQL命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我有一个需要执行MySQL命令的iOS应用:

So, I have an iOS App that need to do a MySQL command:

INSERT INTO SeB
VALUES ('123123','321321')

我不知道如何使用 Objective-C 来执行此命令.有提示吗?

I don't know how to do this command with Objective-C. Any tips?

PS:数据库为在线.

非常感谢!
阿尔贝托(Alberto)

Thanks a lot!!!
Alberto

推荐答案

出于安全原因,像这样在Internet上打开MySQL数据库通常是个坏主意.

It's generally a bad idea to open up a MySQL database on the Internet like this, for security reasons.

相反,您应该设置某种可以接受请求然后连接到数据库的Web服务器.

Instead, you should set up some kind of web server that would accept requests and then connect to the database.

例如,您的iOS应用将向服务器发送常规HTTP请求(例如 http://example.com/request/?data1=123123&data2=321321 ; Web服务器脚本这样便可以检查输入,然后将其写入数据库.

For example, your iOS app would send a regular HTTP request to your server (like http://example.com/request/?data1=123123&data2=321321; the web server script would then be able to check the input and then write to the database.

该网站有很多选项-PHP,Perl,ASP,Ruby等.

There are plenty of options for the web site -- PHP, Perl, ASP, Ruby, etc.

这篇关于Objective-C中的MySQL命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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