我需要 PHP 数据存储的替代方案(类似于 MySQL 和 SQLite DB)

发布于 2024-12-02 03:54:29 字数 277 浏览 5 评论 0原文

我正在开发一个包含订阅表单的 WordPress 主题,该表单目前无法正常工作,因为我不知道在哪里存储用户的信息。

由于目标市场主机的安全性,我无法使用MySQL。我无法使用 SQLite,因为我无法将其预安装到主题中,并且我想让用户尽可能轻松地使用它(已经设置),所以我想让他们做的最后一件事就是设置 SQLite 数据库。

我知道还有其他方法来存储信息,例如在 .txt 文件中,但我需要像数据库一样工作的东西。可以更新某些行中的某些字段等的东西。

有什么想法吗?

谢谢!

I'm working on a WordPress theme that includes a subscribe form which doesn't work correctly at the moment because i can't figure out where to store the user's info.

I cannot use MySQL because of the target market host's security. I cannot use SQLite because I cannot pre-install it into the theme and I'd like to make it as easy for the user as possible (already setup) so the last thing id want to ask them to do is setup a SQLite database.

I know there are other ways to store info, like in .txt files, but i need something that will work like a database. Something that can update certain fields in certain rows etc etc.

Any ideas guys?

Thanks!

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

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

发布评论

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

评论(1

七婞 2024-12-09 03:54:30

您打算如何在没有 MySQL 的情况下运行 WordPress?它不会在任何随机数据库上运行 - 正如 WordPress.org 上所述:

目前,唯一的数据库WordPress 支持 MySQL 版本 4.1.2 或更高版本。

如果您想知道如何在 WordPress 已经使用的数据库(我假设必须是 MySQL)中存储信息,您应该查看 get_user_metaadd_user_metaupdate_user_metadelete_user_meta

这些函数将在 WordPress 数据库中与用户对象一起存储附加信息(元数据),您根本不必担心数据库。只需像调用任何其他 PHP 函数一样调用这些函数就可以了。

How are you planning to get WordPress running without MySQL? It's not like it will run on any random database — as stated on WordPress.org:

Currently, the only database supported by WordPress is MySQL version 4.1.2 or greater.

If you're wondering how to store information in the database WordPress is already using (which I assume must be MySQL), you should have a look at get_user_meta, add_user_meta, update_user_meta and delete_user_meta.

These functions will store additional information (meta data) alongside a user object within WordPress' database and you won't have to worry about the database at all. Just invoke the functions like any other PHP functions and you should be fine.

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