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 'MAX_SELECT_BESTSELLERS) AS a ORDER BY rand_id LIMIT 10' at line 1
SELECT *, RAND() AS rand_id FROM (select distinct p.products_id, p.products_image, pd.products_name from products p, products_description pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '4' order by p.products_ordered desc, pd.products_name limit MAX_SELECT_BESTSELLERS) AS a ORDER BY rand_id LIMIT 10