Using PHP, Kohana 3, and the Auth module, how to structure database for additional user info beyond username, email and password

StackOverflow https://stackoverflow.com/questions/3368117

質問

I'm building the next Facebook!! No, kidding.

I'm building a simple site to help me learn. It will allow users to log in with an email and password.

There will be other information collected from the user that is pertinent to the sites functions.

Using the supplied Kohana Auth module, should I store the separate data in another table?

Example:

The 'users' table has these rows... id, username, email, password, logins, last_login.

Suppose I want to store these for each user in addition... location_id, photo, favorite_color, bio

Should I create another table or just extend this table? How would you do this? Thanks!!

役に立ちましたか?

解決

You could create another one table called user_details where store the user_id and additional fields you need.

他のヒント

Just add the details to the user table and extend the Model_Auth_User class.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top