In Contact us and About us pages in websites some information (For example Address , email , phone and etc) are simple and short, But some Customers want can access them and change dynamically in their Admin panel while developers prefer those were be Static.
However My question is when these information must be Dynamic, what is best approach to Storing them?
Do we must to use Database tables that only have one record (that have easy inserting and fetching) or we must to use files to store then while working with files and change them is hard and time consuming.
which approach is better and usual in modern Systems like Wordpress and other CMS?
A database is the most common because it allows for easy searching and supports complex querying. Databases such as mysql and postgres are also relatively easy to access and update relative to a file system.
In short, both are possible, but a database is the most common approach, and provides many more features and options for future functionality.
Storing data in Database
is the best option due to simplicity, maintainability and easy to access.
Storing in FILE
is not recommended because if you want to get selected user details you will have to read the entire file. Also updating details will be tedious. In case of Database
it can be very easily fetched / updated by a simple query.
So for simplicity and ease go for Database
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.