Forum Moderators: coopster

Message Too Old, No Replies

long-in script + user data one table?

         

Sarah Atkinson

5:22 pm on May 8, 2006 (gmt 0)

10+ Year Member



I am creating a log-in script. I had the username/password in (1) table and the user data in a second table then linking them together with their id#. To make the script simpler and refencing them later easier on me. I put them all into one table. Is this ok? or should they remain seperate?

stajer

6:01 pm on May 8, 2006 (gmt 0)

10+ Year Member



Basic user information (name, address, etc) is fine to keep in the same table as username and password.

Database structure is all about normalization: you never want to have the same data in more than one location. Add a new table if putting the data in an existing table would require you to duplicate it to another table for your appliation to run smoothly. You should favor more tables with fewer columns for best performance.

jatar_k

7:59 pm on May 8, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I have always done it that way Sarah, all in one table for userdata and user/pass, works well.