Question2Answer query failed:

(SELECT '0' AS selectkey, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1) AS basetype, INSTR(qa_posts.type, '_HIDDEN')>0 AS hidden, qa_posts.acount, qa_posts.selchildid, qa_posts.closedbyid, qa_posts.upvotes, qa_posts.downvotes, qa_posts.netvotes, qa_posts.views, qa_posts.hotness, qa_posts.flagcount, qa_posts.title, qa_posts.tags, UNIX_TIMESTAMP(qa_posts.created) AS created, qa_categories.title AS categoryname, qa_categories.backpath AS categorybackpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip) AS createip, qa_userpoints.points, qa_users.flags, qa_users.level, qa_users.email AS email, qa_users.handle AS handle, qa_users.avatarblobid, qa_users.avatarwidth, qa_users.avatarheight, NULL AS wordid, NULL AS word, NULL AS tagcount, NULL AS pageid, NULL AS permit, NULL AS nav, NULL AS position, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_users ON qa_posts.userid=qa_users.userid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN (SELECT postid FROM qa_posttags WHERE wordid=(SELECT wordid FROM qa_words WHERE word='base-цена' AND w'base-цена'rd=$ COLLATE utf8_bin LIMIT 1) ORDER BY postcreated DES0 20IMIT #,#) y ON qa_posts.postid=y.postid) UNION ALL (SELECT '1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, wordid, word, tagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_words WHERE word='base-цена') UNION ALL (SELECT 'pending_navpages', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, flags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, permit+0, nav, position, heading, NULL, NULL FROM qa_pages WHERE nav IN ('B','M','O','F') ORDER BY position) UNION ALL (SELECT 'pending_widgets', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, position, NULL, widgetid, place FROM qa_widgets ORDER BY position)

Error 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 ''base-цена'rd=$ COLLATE utf8_bin LIMIT 1) ORDER BY postcreated DES0 20IMIT #' at line 1