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 substring( categories_id , 1 , 2 ) not in ( 14 , 15 , 16 , 25 )' at line 3

SELECT `categories_id` cid FROM `products_to_categories` ptc inner join products p on ptc . `products_id` = p . `products_id` where p . products_status = 0 and p . `products_id` = and substring( categories_id , 1 , 2 ) not in ( 14 , 15 , 16 , 25 )

[TEP STOP]