1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'int)substr(ptc.categories_id,0,2) and ptc.products_id = '461'' at line 1

select ptc.products_id, ptc.categories_id, cd.categories_id, cd.categories_name from products_to_categories ptc, categories_description cd where cd.categories_id = (int)substr(ptc.categories_id,0,2) and ptc.products_id = '461'

[TEP STOP]