I use this query:
SELECT
`o_p`.`id`,
`o`.`user_id` AS `buyer`,
`product_number`
FROM `order_products` `o_p`
LEFT JOIN `order` `o` ON o.id=o_p.id
WHERE (`o_p`.`product_id`='5') AND (`o`.`pay_status`=1)
then i get this result:
id buyer product_number
20 7 13
26 7 10
27 19 10
or you can see the result at this link
But I want to count the buyer's number which is expected '2',and the total of product_number which is expected '33'.
How should I fix the query.