I have been using PHP for a few months now and am having following problem.
This is an example of a table in my database.
User_id Prod_id
1 1
2 1
3 2
4 3
From a page in the website, I select a prod_id, another table is then created where each user_id is listed alongside the product_id i.e. in the above case, I would select product_id 1 and the list would be output as such:
The following persons are using the (product name)
User_id User_name(drawn from another table in the database)
1
2
I have attempted using loops (while and for), but am continually getting all of the user_id's listed for all of the products.
Any ideas.
Thanks