存储在db或文件中的文本(Text stored in db or in files)

编程入门 行业动态 更新时间:2024-10-28 21:15:37
存储在db或文件中的文本(Text stored in db or in files)

我正在做一个项目(PHP),我需要存储关于一个人的大约4个不同的文本,每个文本包含大约250个字符。 目前,必须完成的次数没有限制。

您是否建议我将4个文本存储在数据库表中,并在用户输入给定人员页面/配置文件时将文本从中拉出,或者我应该从中创建文件?

在速度,可扩展性等方面哪种方法最好。

谢谢

I am doing a project (PHP) where i need to store about 4 different pieces of text about a person, each containing about 250 characters. there is currently no limit to the number times this must be done.

Would you suggest I store the 4 pieces of text in a database table and pull the text out of this, whenever a user enter the given persons page/profile, or should i rather make files out of them?

Which method would be the best in terms of speed, scalability etc.

Thanks

最满意答案

数据库是您想要做的完美解决方案,PHP有很多功能可以使用它们,因此您不必重新发明轮子以将数据存储在平面文件中。

例如,想想你将在6个月内遇到的痛苦,当你必须拿走所有这些文件并为每一个文件添加一个列时...使用DB你只需运行一个简单查询。

所以,基本上,使用数据库。

Databases are the perfect solution for what you want to do, and PHP has plenty of functions to work with them, so you don't have to reinvent the wheel to store data in flat files.

Think, for instance, of the pain you'll have in 6 months time when you'll have to take all those files and add a column to each one of them... With a DB you'd just have to run one very simple query.

So, essentially, use a DB.

更多推荐

本文发布于:2023-07-29 15:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1317541.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文本   文件   db   files   stored

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!