I have the following query
$query2 = "SELECT reverse_products.id, reverse_products.name, reverse_relations.user_id
FROM reverse_products JOIN reverse_relations ON reverse_products.id = reverse_relations.product_id
WHERE product_id = $dealid ";
$row = mysql_fetch_array(mysql_query($query2));
echo "$row[id]: $row[name]";
that shows the id and name of a product from reverse_products table. On the reverse_relations table there are stored *user_id* and *product_id*. There are many *user_id* that may have the same *product_id*.
How to change my query to show :
On how many *user_id* have the same *product_id* ? Do I need a second query for this ?
if I’m understanding your table structure properly.