June 19th, 2013, 03:30 AM
Add products along with logged in user id
i have a website with 2 roles - retailer and customer. the retailer adds, deletes, updates records. different retailers can add the same product. is it possible to add the records by retailer? i mean if the same product is added, it should be linked to the retailer that added it so that i can later query and retrieve records by retailer. i have a retailer table in my database.
any tutorials that i can go through?
any ideas how to do that?
June 19th, 2013, 10:03 AM
This is just...how databases work. Yes, you can link a product to a retailer. put a retailer_id on the table. Or, if you want the same product record to link to multiple retailers (which is actually wrong) you can make a product_retailer_lookup table which contains a product ID and a retailer ID.
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.