INVALID SQL: 1064 : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND p.forsale = 'Y' AND lower(p.param05) = 'brand' and p.nch = '' at line 5
SQL QUERY FAILURE: SELECT p.productid, pp.nch_supplierid as supplierid, p.param05 as type, p.param02 as form, p.param03 as strength, p.param04 as quantity, pp.nch_price as price FROM abconlinedb1.xcart_products p left join abconlinedb1.xcart_pricing pp on p.productid = pp.productid WHERE p.masterid = AND p.forsale = 'Y' AND lower(p.param05) = 'brand' and p.nch = 'Y' and pp.nch_price > 0 ORDER BY strength, quantity