Invalid query: 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 'AND wug.wbm_user_groups_languages_id = 1 AND wugp.wbm_user_groups_languages_i...' at line 6
Whole query: SELECT wug.wbm_user_groups_id as user_groups_id, wug.wbm_user_groups_name as user_groups_name, wug.wbm_user_groups_indic_permalink as user_groups_indic_permalink, wugp.wbm_user_groups_id as user_groups_parent FROM to_groups as wug2g INNER JOIN wbm_user_groups as wug ON wug.wbm_user_groups_id = wug2g.wbm_user_groups_id INNER JOIN wbm_user_groups as wugp ON wugp.wbm_user_groups_id = wug.wbm_user_groups_parent WHERE wug2g.ref_table='product' AND wug2g.ref_id= AND wug.wbm_user_groups_languages_id = 1 AND wugp.wbm_user_groups_languages_id = 1 ORDER BY wugp.wbm_user_groups_id