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