如何在 PALM webOS 中连接到外部数据库(例如 MySQL)

发布于 2024-10-21 05:28:20 字数 110 浏览 8 评论 0原文

我有一个托管在 wampserver 上的 php 代码和一个托管在 phpmyadmin 上的 MySql 数据库。我尝试使用我在场景辅助文件中编写的Ajax请求函数来调用PHP访问数据库,但它不起作用。

I have a php code which i hosted on wampserver and a MySql database which I hosted in phpmyadmin. I have tried using Ajax request function which I wrote in the scene assistance file to call the PHP to access the database but its not working.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

玩世 2024-10-28 05:28:20

我建议不要从设备直接连接到数据库。应用程序通常不会这样做,这是有充分理由的:

  • 诸如 mysql 之类的数据库服务器不太擅长处理多个低延迟连接。
  • 实际上,您将允许任何人访问数据库,并且如果您对不同的用户使用 mysql 的身份验证,那么这不是最好的方法。您会使用 SSL 吗?因为否则用户名/密码将通过未经过滤的网络管道传输,从而使您的服务器面临多种安全风险。
  • 更新更困难,缓存不可能......等等......有很多原因。

大多数应用程序所做的实际上是创建一个服务器端应用程序,该应用程序将以 RESTful 方式处理来自应用程序的请求。因此,您的应用程序将查询类似 http://myappdomain.com/objects/list 的内容并返回 json 或 XML 等。

I would advise against connecting straight to the database from the device. Apps generally don't do that and there are very good reasons:

  • A database server such as mysql isn't very good with handling multiple low-latency connections.
  • You'll actually be allowing anybody access to the database and if you're using mysql's authentication for different users, that's not the best method. Will you be using SSL? because else the usersnames/passwords will be travelling through network pipes unfiltered exposing your server to multiple security risks.
  • Updates are harder, caching is impossible.. etc.. many reasons.

What most apps do is actually create a server side application that will handle requests from the app in a RESTful way. So your app will query something like http://myappdomain.com/objects/list and return json or XML etc..

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文