mysql database normalization question

Posted by Chocho on Stack Overflow See other posts from Stack Overflow or by Chocho
Published on 2010-04-09T15:09:30Z Indexed on 2010/04/09 15:13 UTC
Read the original article Hit count: 398

Filed under:
|
|
|

here is my 3 tables:

table 1 -- stores user information and it has unique data

table 2 -- stores place category such as, toronto, ny, london, etc hence this is is also unique

table 3 -- has duplicate information. it stores all the places a user have been.

the 3 tables are linked or joined by these ids:

table 1 has an "table1_id"

table 2 has an "table2_id" and "place_name"

table 3 has an "table3_id", "table1_id", "place_name"

i have an interface where an admin sees all users. beside a user is "edit" button. clicking on that edit button allows you to edit a specific user in a form fields which has a multiple drop down box for "places".

if an admin edits a user and add 1 "places" for the user, i insert that information using php. if the admin decides to deselect that 1 "places" do i delete it or mark it as on and off? how about if the admin decides to select 2 "places" for the user; change the first "places" and add an additional "places". will my table just keep growing and will i have just redundant information?

thanks.

© Stack Overflow or respective owner

Related posts about mysql

Related posts about query