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 'order by RAND() limit 6' at line 1

select distinct p.products_id, p.products_image from products p JOIN products_to_categories p2c ON p2c.products_id=p.products_id where p2c.categories_id = '0' and p.products_status = '1' AND p.products_id != order by RAND() limit 6

[TEP STOP]