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 `pid` = 0' at line 1
SELECT `id`, `topic_cn` AS `topic`, `sort_id` FROM category WHERE `status` = 1 AND `id` = AND `pid` = 0