View Poll Results: How to give permission for differen product for different user

Voters
1. You may not vote on this poll
  • Need Help

    1 100.00%
  • Need Help

    0 0%
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    1

    Red face Unanswered: How to give permission of for different products for particular users can see

    Hi,
    I have written my code in php and I have two table namely "user" table and "product" table.
    The "user" table consisting only id and password and "product" table consisting product ids and product name.

    Eg.
    User
    -------------------
    user_id | Password
    -------------------
    A | abc
    B | xyz
    C | dcs

    Product Table
    --------------------------------------------
    prod_id | prod_name | prod_desc | prod_price
    --------------------------------------------
    1 | Apple | Fruit | $1
    2 | Banana | Fruit | $.50
    3 | Milk | Liquid | $2
    4 | Paper | Paper | $1

    I have created a checkbox like
    <input type="checkbox" name="product[] value="<?=$sql['prod_id'];?>">
    in while loop.

    Now I want to show the prod_id 2,4 can see only user A, prod_id 3 only user C and prod_id 1,2,3,4 user B can see.

    Please solve my problem, how to insert the data into the table and how to fetch data from the table so that a particular user can see only the permitted products not other product.

    Waiting for reply very soon
    Thanks,
    MASM

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so how do you think you can achieve this
    what wasy can you see to achieve this design requirement
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    Here's a hint, you need to relate the users to the products somehow... maybe... and I know I could be spitting into the wind here... you could use another table

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •