SQL/PHP: Show top 3 most sold products from database
问题 I have a database containing the following tables: - product (product_id / name / price / image_id / description) - order ( order_id / date / status / email ) - order_count ( order_id / product_id / number ) - image (image_id / image_link ) I'd like to show the 3 most sold products on my homepage, but can't wrap my head around doing this. I tried this: $sql = "SELECT" * FROM 'product' INNER JOIN 'afbeelding' WHERE 'product'.'image_id' = 'afbeelding'.'image_id' GROUP BY 'product_id' ORDER BY