在 HTML 5 中从 SQL 数据库提取数据

发布于 2025-01-04 21:15:19 字数 840 浏览 2 评论 0原文

我正在尝试开发一个 BlackBerry 应用程序,该应用程序将显示来自服务器 SQL 数据库的数据。我正在研究黑莓 (WebWorks) 的新 HTML 5 选项,并注意到它本身显然无法连接到任何服务器数据。一些链接指出我需要 JavaScript 编码才能获取它。我研究了 PhoneGap 的选项(链接在这里:http://phonegap.com/)并决定我尝试使用 HTML 5 来生成应用程序。我以前从未接触过 SQL 数据库,我想知道如何将两者连接起来;意思是如果您使用的是 HTML5,如何从服务器提取数据?

我看过:

数据在哪里使用 HTML 5 Web SQL 数据库时存储

拉取过程数据来自sql 数据库

等等,但我仍然不确定该怎么做。我希望“查看”来自服务器的数据并将其显示在应用程序上。它会是这样的:

- HomeScreen:您想查看什么数据?:
- 类别下拉列表(来自数据库)
- 在下拉列表中选择条目可获取可用信息(来自数据库)

如有任何帮助,我们将不胜感激,当然,提前致谢。

I am trying to develop a BlackBerry application that will show data from an SQL Database from a server. I was researching the new HTML 5 option for blackberry (WebWorks) and noticed that it apparently cannot connect to any server data by itself. Some links state that I would need javascript coding to obtain it. I looked into the option of PhoneGap (link here: http://phonegap.com/) and decided I'd try using HTML 5 to produce the application. I have never touched SQL databases before and I am wondering how I would connect the two; meaning how do you pull data from the server given that you are working with HTML5?

I have looked at:

Where is data stored when using an HTML 5 Web SQL Database

Process for pulling data from a sql database

among others but I am still unsure as to what to do. I would be looking to "view" the data from the server and display it on the app. It would be something of the sort:

- HomeScreen: What data would you like to view?:
- Dropdown list of categories (from the database)
- Selecting Entry in dropdown leads to available information (from the database)

Any help would be appreciated, and of course thanks in advance.

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

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

发布评论

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

评论(1

泪冰清 2025-01-11 21:15:19

HTML5 的新(而且非常棒)功能正在客户端的浏览器中实现。您需要的是服务器端的后端来执行一些魔法。确实,浏览器现在拥有数据库,但这些数据库位于手机、计算机等上,据我了解您的问题,您希望这些数据与服​​务器上的数据进行通信。要在网络上移动数据,您需要执行 HTTP 请求,这可以通过 javascript 和 ajax 轻松完成。研究一下这些技术,制作一个小的服务器端脚本,从数据库收集数据并将其以结构化格式发送到手机(JSON、XML),然后在客户端用 javascript 制作一个脚本来解析这些数据数据并利用它们。

祝你好运!

the new (and pretty awesome) features of HTML5 is happening in the browser on the client side. What you will need is a back-end on the server side doing some magic. It is true that browsers now have databases but these are located on the phone, computer etc and as I understand your question you want these data to communicate with data on your server. To move data across the web you will need to perform HTTP-requests which can easily be done through javascript and ajax. Look a bit into these technologies and make a little server-side script that gathers data from the database and send it in a structured format to the phone (JSON, XML), then make a script in javascript on the client-side that parse these data and utilise them.

Good luck!

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