mysql - How do I make a php page that reads different selections for different users? -
i have mysql lists 500 items. users can register @ site , mark item have already. simple php reads table , each row.
how should structure database each user can have particular setting each item?
so when bob opens account, sees has item 1, when mary opens it, she'll have item 1 missing , can see has item 1 twice or more times may contact whoever has more 1 of item?
you this:
have table shows users have items...
table name: user_items
primary_key | user_id | item_number ----------------------------------- 1 | 1 | 1 2 | 1 | 1 3 | 1 | 2 4 | 2 | 2
or have this
primary_key | username | item_number ----------------------------------- 1 | bob | 1 2 | bob | 1 3 | bob | 2 4 | mary | 2
this table above shows that:
user 1 / bob has:
- item 1 x2
- item 2
user 2 / mary has:
- item 2
Comments
Post a Comment