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 art_pret > 0
AND art_status_id>0)
UNION
(SELECT *' at line 7 la SQL ((SELECT * FROM t_articole AS a
INNER JOIN t_categorii AS c ON c.cat_id=a.art_cat_id
INNER JOIN t_producatori AS p ON p.prod_id=a.art_prod_id
WHERE art_cat_id=''
AND ((art_stoc_cta+art_stoc_buc+art_stoc_htw+art_stoc_ti_cta+art_stoc_ti_buc+art_stoc_xum)>0)
AND art_pret <
AND art_pret > 0
AND art_status_id>0)
UNION
(SELECT * FROM t_articole AS a
INNER JOIN t_categorii AS c ON c.cat_id=a.art_cat_id
INNER JOIN t_producatori AS p ON p.prod_id=a.art_prod_id
WHERE art_cat_id=''
AND ((art_stoc_cta+art_stoc_buc+art_stoc_htw+art_stoc_ti_cta+art_stoc_ti_buc+art_stoc_xum)>0)
AND art_pret <0
AND art_pret >
AND art_status_id>0)
)