我用一个数据库或两个? [英] do I use one database or two?

查看:137
本文介绍了我用一个数据库或两个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

行,所以我正在做一个成员只有网站。我想它设置,使每个人都有登录到该网站访问任何功能。

OK so I'm making a members only site. I want it set up so that every one has to log in to the site to access any features.

事情是我需要2个类型的消费者(人在广告购买服务多数民众赞成)和第二级帐户账户1供用户有额外的网站功能,能够描述那里的业务和邮政广告联系人信息,位置和这样

Thing is I need 2 types of accounts 1 for consumers (people to buy the services thats in the ads.) and a 2nd level account for users to have extra site feature to be able to describe there business and post ads contact information, location, and such.

截至目前我有它在数据库中建立了凡在我的网站用户注册它会发送确认电子邮件,还有电子邮件,当用户点击它只是从0变为数据库激活激活链接到1巫婆给到现场的用户访问。

As of now I have it set up in the data base where a user registers at my site it will send a verification email to there email and when the user clicks the activation link it simply changes the database "activation" from a 0 to a 1 witch gives that user access to the site.

所以我的问题是我能不能设置激活在我的数据库去到一个更高的数字,如2,这样我就可以有主动1作为消费者和活跃2卖家?

So my question is can I just set the "active" in my database to go to a higher number such as 2 so that I can have "active" 1 as consumers and "active" 2 for sellers?

或者我需要为消费者和另一个数据库的卖方

Or do I need to make a separate database for "consumer" and another database for the "seller"

先谢谢了。

推荐答案

除非有帐户,您希望单独的信息,我能想到的任何理由这种做法不应该是有效的。 活跃属性看作一个实际的状态的其中0表示不活动,1是指消费者,2是指卖家等。
你甚至可以把普通字符串在那里,像不活跃,消费者,卖方,很像一个枚举类型。这是所有到您的实现。

Unless there is account information you wish to separate, I can think of no reason why this approach should not be valid. Think of the "active" property as an actual status where "0" means inactive, "1" means consumer, "2" means seller etc. You could even put plain strings in there, like "INACTIVE", "CONSUMER", "SELLER", much like an enumeration type. It is all up to your implementation.

这篇关于我用一个数据库或两个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆