I need help have problem to run this query in php :
SELECT prod_code, prod_desc, SUM(pay_qty * unit_qty) as pay, SUM(free_qty * unit_qty) as free
FROM branchsell
WHERE bcode='1U'
AND od_date BETWEEN DATE_SUB(DATE_SUB(CURDATE(),INTERVAL (DAY(CURDATE())-1) DAY), INTERVAL 1 MONTH)
AND DATE_SUB(CURDATE(),INTERVAL (DAY(CURDATE())) DAY)
AND ( (prod_code BETWEEN '20000000' AND '39999999' )
OR (prod_code='85000002')
OR (prod_code BETWEEN '50000000' AND '59999999'))
GROUP BY prod_code;