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 'g '') AND category_weight.cat_id = ( SELECT cat_id FROM categories WHERE cat_ur' at line 39