我需要 PHP 数据存储的替代方案(类似于 MySQL 和 SQLite DB)
我正在开发一个包含订阅表单的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您打算如何在没有 MySQL 的情况下运行 WordPress?它不会在任何随机数据库上运行 - 正如 WordPress.org 上所述:
如果您想知道如何在 WordPress 已经使用的数据库(我假设必须是 MySQL)中存储信息,您应该查看
get_user_meta
、add_user_meta
、update_user_meta
和
delete_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:
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
anddelete_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.