$result_cat=mysql_query("select product.Product_id,product.Product_name, SUM(sell.total_sell) AS SUMTOTAL,SUM(sell_detail.num_pro)
AS SUMQTY FROM sell,sell_detail,product where (sell.sell_id=sell_detail.ref_sell_id) and (sell_detail.ref_pro_id=product.Product_id) and substr(sell.date_sell, -7,7)='$monthnow' GROUP BY sell_detail.ref_pro_id ORDER BY product.Product_id=sell_detail.num_pro desc");