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

Question

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!!

Was it helpful?

Solution

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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top