开发者

CMS Settings, .INI file or MySQL?

I'm looking for the best solution to store the ettings for a website, like the limit of posts for users, limit of users online, ranks, min. number of posts to be able to do something. Like here, if you're new you can't thumbs up/down a post, or whatever, so how would you store all o开发者_运维技巧f these? I thought of creating a table with constants in mysql but i think it's not the best solution to add a new mysql query on every page refresh.


Why not? After all, MySQL can handle a large number of requests and I've seen much more complex queries than checking access rights. A MySQL query is a query to a file just like checking an INI file, but optimized. I'm guessing that if you don't expect a huge amount of traffic, you'll be fine with a database.

Here it's a matter of preference. I prefer to do this in MySQL because I don't like to parse files and find querying a database easier. Also, editing rows is easier than changing values in a text file.

I'd say your first thought was spot-on. Put constants into a database.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜