Is there a table that can only record one row of information, such as enterprise website, website introduction, setting information, address, and other information, only one row is required, how can such a table record be created?
As you asked, we will encounter this list of scenarios. It is more troublesome to read and write files. Files are more suitable for some fixed Hard coding configurations.
K-V, with memcache,redis memory database, but also worried about data loss. Then MySQL is based on relational, so
We can skillfully use the database to create a small K-V database.
Create a table with KEY and VALUE fields for storing information that can be read or written.
In fact, to put it bluntly, it is to build a simple K-V database.
A record represents a configuration.
For example, the configuration contains website information, administrator interface style, expiration time, etc.
id dicKey value 1 web_info "enterprise website, website introduction, setting information, address, etc." 2 admin_style "green" 3 expire 360
Next, as long as you encapsulate the logic yourself
It can be done completely.