#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2013
    Posts
    30
    Rep Power
    0

    Add products along with logged in user id


    hello,

    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?
  2. #2
  3. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,905
    Rep Power
    6351
    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.

IMN logo majestic logo threadwatch logo seochat tools logo