#0 qa_page_db_fail_handler(query, 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank, NULL AS postid, NULL AS categoryid, NULL AS type, NULL AS basetype, NULL A' at line 1, (SELECT '3' AS selectkey, points, qposts, aposts, cposts, aselects, aselecteds, qupvotes, qdownvotes, aupvotes, adownvotes, qvoteds, avoteds, upvoteds, downvoteds, bonus, NULL AS rank, NULL AS postid, NULL AS categoryid, NULL AS type, NULL AS basetype, NULL AS hidden, NULL AS acount, NULL AS selchildid, NULL AS closedbyid, NULL AS upvotes, NULL AS downvotes, NULL AS netvotes, NULL AS views, NULL AS hotness, NULL AS flagcount, NULL AS title, NULL AS tags, NULL AS created, NULL AS categoryname, NULL AS categorybackpath, NULL AS userid, NULL AS cookieid, NULL AS createip, NULL AS obasetype, NULL AS ohidden, NULL AS opostid, NULL AS ouserid, NULL AS ocookieid, NULL AS oip, NULL AS otime, NULL AS oflagcount, NULL AS oupdatetype, NULL AS oupdated, NULL AS pageid, NULL AS flags, NULL AS permit, NULL AS nav, NULL AS position, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_userpoints WHERE userid='2') UNION ALL (SELECT '4', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1+COUNT(*), 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, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userpoints WHERE points>COALESCE((SELECT points FROM qa_userpoints WHERE userid='2'), 0)) UNION ALL (SELECT '5', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid WHERE qa_posts.userid='2' AND type='Q' ORDER BY qa_posts.created DESC LIMIT 20) UNION ALL (SELECT '6', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(aposts.type, 1), INSTR(aposts.type, '_HIDDEN')>0, aposts.postid, aposts.userid, aposts.cookieid, INET_NTOA(aposts.createip), UNIX_TIMESTAMP(aposts.created), aposts.flagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS aposts ON qa_posts.postid=aposts.parentid JOIN (SELECT postid FROM qa_posts WHERE userid='2' AND type='A' ORDER BY created DESC LIMIT 50) y ON aposts.postid=y.postid WHERE qa_posts.type='Q') UNION ALL (SELECT '7', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(cposts.type, 1), INSTR(cposts.type, '_HIDDEN')>0, cposts.postid, cposts.userid, cposts.cookieid, INET_NTOA(cposts.createip), UNIX_TIMESTAMP(cposts.created), cposts.flagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=(CASE parentposts.type WHEN 'A' THEN parentposts.parentid ELSE parentposts.postid END) JOIN qa_posts AS cposts ON parentposts.postid=cposts.parentid JOIN (SELECT postid FROM qa_posts WHERE userid='2' AND type='C' ORDER BY created DESC LIMIT 50) y ON cposts.postid=y.postid WHERE qa_posts.type='Q' AND parentposts.type IN ('Q', 'A')) UNION ALL (SELECT '8', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(editposts.type, 1), INSTR(editposts.type, '_HIDDEN')>0, editposts.postid, editposts.lastuserid, editposts.cookieid, INET_NTOA(editposts.lastip), UNIX_TIMESTAMP(editposts.updated), editposts.flagcount, editposts.updatetype, UNIX_TIMESTAMP(editposts.updated), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=IF(LEFT(parentposts.type, 1)='Q', parentposts.postid, parentposts.parentid) JOIN qa_posts AS editposts ON parentposts.postid=IF(LEFT(editposts.type, 1)='Q', editposts.postid, editposts.parentid) JOIN (SELECT postid FROM qa_posts WHERE lastuserid='2' AND type IN ('Q', 'A', 'C') ORDER BY updated DESC LIMIT 50) y ON editposts.postid=y.postid WHERE parentposts.type IN ('Q', 'A', 'C') AND qa_posts.type IN ('Q', 'A', 'C')) UNION ALL (SELECT 'pending_navpages', 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, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, flags, 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, NULL, NULL, 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)) called at [/var/www/otvety.sim-portal.ru/qa-include/qa-db.php:110] #1 qa_db_fail_error(query, 1064, You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rank, NULL AS postid, NULL AS categoryid, NULL AS type, NULL AS basetype, NULL A' at line 1, (SELECT '3' AS selectkey, points, qposts, aposts, cposts, aselects, aselecteds, qupvotes, qdownvotes, aupvotes, adownvotes, qvoteds, avoteds, upvoteds, downvoteds, bonus, NULL AS rank, NULL AS postid, NULL AS categoryid, NULL AS type, NULL AS basetype, NULL AS hidden, NULL AS acount, NULL AS selchildid, NULL AS closedbyid, NULL AS upvotes, NULL AS downvotes, NULL AS netvotes, NULL AS views, NULL AS hotness, NULL AS flagcount, NULL AS title, NULL AS tags, NULL AS created, NULL AS categoryname, NULL AS categorybackpath, NULL AS userid, NULL AS cookieid, NULL AS createip, NULL AS obasetype, NULL AS ohidden, NULL AS opostid, NULL AS ouserid, NULL AS ocookieid, NULL AS oip, NULL AS otime, NULL AS oflagcount, NULL AS oupdatetype, NULL AS oupdated, NULL AS pageid, NULL AS flags, NULL AS permit, NULL AS nav, NULL AS position, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_userpoints WHERE userid='2') UNION ALL (SELECT '4', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1+COUNT(*), 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, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userpoints WHERE points>COALESCE((SELECT points FROM qa_userpoints WHERE userid='2'), 0)) UNION ALL (SELECT '5', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid WHERE qa_posts.userid='2' AND type='Q' ORDER BY qa_posts.created DESC LIMIT 20) UNION ALL (SELECT '6', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(aposts.type, 1), INSTR(aposts.type, '_HIDDEN')>0, aposts.postid, aposts.userid, aposts.cookieid, INET_NTOA(aposts.createip), UNIX_TIMESTAMP(aposts.created), aposts.flagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS aposts ON qa_posts.postid=aposts.parentid JOIN (SELECT postid FROM qa_posts WHERE userid='2' AND type='A' ORDER BY created DESC LIMIT 50) y ON aposts.postid=y.postid WHERE qa_posts.type='Q') UNION ALL (SELECT '7', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(cposts.type, 1), INSTR(cposts.type, '_HIDDEN')>0, cposts.postid, cposts.userid, cposts.cookieid, INET_NTOA(cposts.createip), UNIX_TIMESTAMP(cposts.created), cposts.flagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=(CASE parentposts.type WHEN 'A' THEN parentposts.parentid ELSE parentposts.postid END) JOIN qa_posts AS cposts ON parentposts.postid=cposts.parentid JOIN (SELECT postid FROM qa_posts WHERE userid='2' AND type='C' ORDER BY created DESC LIMIT 50) y ON cposts.postid=y.postid WHERE qa_posts.type='Q' AND parentposts.type IN ('Q', 'A')) UNION ALL (SELECT '8', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(editposts.type, 1), INSTR(editposts.type, '_HIDDEN')>0, editposts.postid, editposts.lastuserid, editposts.cookieid, INET_NTOA(editposts.lastip), UNIX_TIMESTAMP(editposts.updated), editposts.flagcount, editposts.updatetype, UNIX_TIMESTAMP(editposts.updated), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=IF(LEFT(parentposts.type, 1)='Q', parentposts.postid, parentposts.parentid) JOIN qa_posts AS editposts ON parentposts.postid=IF(LEFT(editposts.type, 1)='Q', editposts.postid, editposts.parentid) JOIN (SELECT postid FROM qa_posts WHERE lastuserid='2' AND type IN ('Q', 'A', 'C') ORDER BY updated DESC LIMIT 50) y ON editposts.postid=y.postid WHERE parentposts.type IN ('Q', 'A', 'C') AND qa_posts.type IN ('Q', 'A', 'C')) UNION ALL (SELECT 'pending_navpages', 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, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, flags, 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, NULL, NULL, 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)) called at [/var/www/otvety.sim-portal.ru/qa-include/qa-db.php:198] #2 qa_db_query_raw((SELECT '3' AS selectkey, points, qposts, aposts, cposts, aselects, aselecteds, qupvotes, qdownvotes, aupvotes, adownvotes, qvoteds, avoteds, upvoteds, downvoteds, bonus, NULL AS rank, NULL AS postid, NULL AS categoryid, NULL AS type, NULL AS basetype, NULL AS hidden, NULL AS acount, NULL AS selchildid, NULL AS closedbyid, NULL AS upvotes, NULL AS downvotes, NULL AS netvotes, NULL AS views, NULL AS hotness, NULL AS flagcount, NULL AS title, NULL AS tags, NULL AS created, NULL AS categoryname, NULL AS categorybackpath, NULL AS userid, NULL AS cookieid, NULL AS createip, NULL AS obasetype, NULL AS ohidden, NULL AS opostid, NULL AS ouserid, NULL AS ocookieid, NULL AS oip, NULL AS otime, NULL AS oflagcount, NULL AS oupdatetype, NULL AS oupdated, NULL AS pageid, NULL AS flags, NULL AS permit, NULL AS nav, NULL AS position, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_userpoints WHERE userid='2') UNION ALL (SELECT '4', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1+COUNT(*), 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, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userpoints WHERE points>COALESCE((SELECT points FROM qa_userpoints WHERE userid='2'), 0)) UNION ALL (SELECT '5', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid WHERE qa_posts.userid='2' AND type='Q' ORDER BY qa_posts.created DESC LIMIT 20) UNION ALL (SELECT '6', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(aposts.type, 1), INSTR(aposts.type, '_HIDDEN')>0, aposts.postid, aposts.userid, aposts.cookieid, INET_NTOA(aposts.createip), UNIX_TIMESTAMP(aposts.created), aposts.flagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS aposts ON qa_posts.postid=aposts.parentid JOIN (SELECT postid FROM qa_posts WHERE userid='2' AND type='A' ORDER BY created DESC LIMIT 50) y ON aposts.postid=y.postid WHERE qa_posts.type='Q') UNION ALL (SELECT '7', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(cposts.type, 1), INSTR(cposts.type, '_HIDDEN')>0, cposts.postid, cposts.userid, cposts.cookieid, INET_NTOA(cposts.createip), UNIX_TIMESTAMP(cposts.created), cposts.flagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=(CASE parentposts.type WHEN 'A' THEN parentposts.parentid ELSE parentposts.postid END) JOIN qa_posts AS cposts ON parentposts.postid=cposts.parentid JOIN (SELECT postid FROM qa_posts WHERE userid='2' AND type='C' ORDER BY created DESC LIMIT 50) y ON cposts.postid=y.postid WHERE qa_posts.type='Q' AND parentposts.type IN ('Q', 'A')) UNION ALL (SELECT '8', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(editposts.type, 1), INSTR(editposts.type, '_HIDDEN')>0, editposts.postid, editposts.lastuserid, editposts.cookieid, INET_NTOA(editposts.lastip), UNIX_TIMESTAMP(editposts.updated), editposts.flagcount, editposts.updatetype, UNIX_TIMESTAMP(editposts.updated), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=IF(LEFT(parentposts.type, 1)='Q', parentposts.postid, parentposts.parentid) JOIN qa_posts AS editposts ON parentposts.postid=IF(LEFT(editposts.type, 1)='Q', editposts.postid, editposts.parentid) JOIN (SELECT postid FROM qa_posts WHERE lastuserid='2' AND type IN ('Q', 'A', 'C') ORDER BY updated DESC LIMIT 50) y ON editposts.postid=y.postid WHERE parentposts.type IN ('Q', 'A', 'C') AND qa_posts.type IN ('Q', 'A', 'C')) UNION ALL (SELECT 'pending_navpages', 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, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, flags, 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, NULL, NULL, 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)) called at [/var/www/otvety.sim-portal.ru/qa-include/qa-db.php:554] #3 qa_db_multi_select(Array ([3] => Array ([columns] => Array ([0] => points,[1] => qposts,[2] => aposts,[3] => cposts,[4] => aselects,[5] => aselecteds,[6] => qupvotes,[7] => qdownvotes,[8] => aupvotes,[9] => adownvotes,[10] => qvoteds,[11] => avoteds,[12] => upvoteds,[13] => downvoteds,[14] => bonus),[source] => ^userpoints WHERE userid=$,[arguments] => Array ([0] => 2),[single] => 1,[outcolumns] => Array ([points] => points,[qposts] => qposts,[aposts] => aposts,[cposts] => cposts,[aselects] => aselects,[aselecteds] => aselecteds,[qupvotes] => qupvotes,[qdownvotes] => qdownvotes,[aupvotes] => aupvotes,[adownvotes] => adownvotes,[qvoteds] => qvoteds,[avoteds] => avoteds,[upvoteds] => upvoteds,[downvoteds] => downvoteds,[bonus] => bonus),[autocolumn] => Array ([points] => 1,[qposts] => 1,[aposts] => 1,[cposts] => 1,[aselects] => 1,[aselecteds] => 1,[qupvotes] => 1,[qdownvotes] => 1,[aupvotes] => 1,[adownvotes] => 1,[qvoteds] => 1,[avoteds] => 1,[upvoteds] => 1,[downvoteds] => 1,[bonus] => 1)),[4] => Array ([columns] => Array ([rank] => 1+COUNT(*)),[source] => ^userpoints WHERE points>COALESCE((SELECT points FROM ^userpoints WHERE userid=$), 0),[arguments] => Array ([0] => 2),[arrayvalue] => rank,[single] => 1,[outcolumns] => Array ([rank] => 1+COUNT(*)),[autocolumn] => Array ()),[5] => Array ([columns] => Array ([0] => ^posts.postid,[1] => ^posts.categoryid,[2] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[3] => ^posts.acount,[4] => ^posts.selchildid,[5] => ^posts.closedbyid,[6] => ^posts.upvotes,[7] => ^posts.downvotes,[8] => ^posts.netvotes,[9] => ^posts.views,[10] => ^posts.hotness,[11] => ^posts.flagcount,[12] => ^posts.title,[13] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[14] => ^posts.userid,[15] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[16] => ^userpoints.points),[arraykey] => postid,[source] => ^posts LEFT JOIN ^categories ON ^categories.categoryid=^posts.categoryid LEFT JOIN ^userpoints ON ^posts.userid=^userpoints.userid WHERE ^posts.userid=$ AND type='Q' ORDER BY ^posts.created DESC LIMIT #,[arguments] => Array ([0] => 2,[1] => 20),[sortdesc] => created,[outcolumns] => Array ([postid] => ^posts.postid,[categoryid] => ^posts.categoryid,[type] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[acount] => ^posts.acount,[selchildid] => ^posts.selchildid,[closedbyid] => ^posts.closedbyid,[upvotes] => ^posts.upvotes,[downvotes] => ^posts.downvotes,[netvotes] => ^posts.netvotes,[views] => ^posts.views,[hotness] => ^posts.hotness,[flagcount] => ^posts.flagcount,[title] => ^posts.title,[tags] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[userid] => ^posts.userid,[cookieid] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[points] => ^userpoints.points),[autocolumn] => Array ([postid] => 1,[categoryid] => 1,[type] => 1,[acount] => 1,[selchildid] => 1,[closedbyid] => 1,[upvotes] => 1,[downvotes] => 1,[netvotes] => 1,[views] => 1,[hotness] => 1,[flagcount] => 1,[title] => 1,[tags] => 1,[userid] => 1,[cookieid] => 1,[points] => 1)),[6] => Array ([columns] => Array ([0] => ^posts.postid,[1] => ^posts.categoryid,[2] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[3] => ^posts.acount,[4] => ^posts.selchildid,[5] => ^posts.closedbyid,[6] => ^posts.upvotes,[7] => ^posts.downvotes,[8] => ^posts.netvotes,[9] => ^posts.views,[10] => ^posts.hotness,[11] => ^posts.flagcount,[12] => ^posts.title,[13] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[14] => ^posts.userid,[15] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[16] => ^userpoints.points,[obasetype] => LEFT(aposts.type, 1),[ohidden] => INSTR(aposts.type, '_HIDDEN')>0,[opostid] => aposts.postid,[ouserid] => aposts.userid,[ocookieid] => aposts.cookieid,[oip] => INET_NTOA(aposts.createip),[otime] => UNIX_TIMESTAMP(aposts.created),[oflagcount] => aposts.flagcount),[arraykey] => opostid,[source] => ^posts LEFT JOIN ^categories ON ^categories.categoryid=^posts.categoryid LEFT JOIN ^userpoints ON ^posts.userid=^userpoints.userid JOIN ^posts AS aposts ON ^posts.postid=aposts.parentid JOIN (SELECT postid FROM ^posts WHERE userid=$ AND type='A' ORDER BY created DESC LIMIT #) y ON aposts.postid=y.postid WHERE ^posts.type='Q',[arguments] => Array ([0] => 2,[1] => 50),[sortdesc] => otime,[outcolumns] => Array ([postid] => ^posts.postid,[categoryid] => ^posts.categoryid,[type] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[acount] => ^posts.acount,[selchildid] => ^posts.selchildid,[closedbyid] => ^posts.closedbyid,[upvotes] => ^posts.upvotes,[downvotes] => ^posts.downvotes,[netvotes] => ^posts.netvotes,[views] => ^posts.views,[hotness] => ^posts.hotness,[flagcount] => ^posts.flagcount,[title] => ^posts.title,[tags] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[userid] => ^posts.userid,[cookieid] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[points] => ^userpoints.points,[obasetype] => LEFT(aposts.type, 1),[ohidden] => INSTR(aposts.type, '_HIDDEN')>0,[opostid] => aposts.postid,[ouserid] => aposts.userid,[ocookieid] => aposts.cookieid,[oip] => INET_NTOA(aposts.createip),[otime] => UNIX_TIMESTAMP(aposts.created),[oflagcount] => aposts.flagcount),[autocolumn] => Array ([postid] => 1,[categoryid] => 1,[type] => 1,[acount] => 1,[selchildid] => 1,[closedbyid] => 1,[upvotes] => 1,[downvotes] => 1,[netvotes] => 1,[views] => 1,[hotness] => 1,[flagcount] => 1,[title] => 1,[tags] => 1,[userid] => 1,[cookieid] => 1,[points] => 1)),[7] => Array ([columns] => Array ([0] => ^posts.postid,[1] => ^posts.categoryid,[2] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[3] => ^posts.acount,[4] => ^posts.selchildid,[5] => ^posts.closedbyid,[6] => ^posts.upvotes,[7] => ^posts.downvotes,[8] => ^posts.netvotes,[9] => ^posts.views,[10] => ^posts.hotness,[11] => ^posts.flagcount,[12] => ^posts.title,[13] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[14] => ^posts.userid,[15] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[16] => ^userpoints.points,[obasetype] => LEFT(cposts.type, 1),[ohidden] => INSTR(cposts.type, '_HIDDEN')>0,[opostid] => cposts.postid,[ouserid] => cposts.userid,[ocookieid] => cposts.cookieid,[oip] => INET_NTOA(cposts.createip),[otime] => UNIX_TIMESTAMP(cposts.created),[oflagcount] => cposts.flagcount),[arraykey] => opostid,[source] => ^posts LEFT JOIN ^categories ON ^categories.categoryid=^posts.categoryid LEFT JOIN ^userpoints ON ^posts.userid=^userpoints.userid JOIN ^posts AS parentposts ON ^posts.postid=(CASE parentposts.type WHEN 'A' THEN parentposts.parentid ELSE parentposts.postid END) JOIN ^posts AS cposts ON parentposts.postid=cposts.parentid JOIN (SELECT postid FROM ^posts WHERE userid=$ AND type='C' ORDER BY created DESC LIMIT #) y ON cposts.postid=y.postid WHERE ^posts.type='Q' AND parentposts.type IN ('Q', 'A'),[arguments] => Array ([0] => 2,[1] => 50),[sortdesc] => otime,[outcolumns] => Array ([postid] => ^posts.postid,[categoryid] => ^posts.categoryid,[type] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[acount] => ^posts.acount,[selchildid] => ^posts.selchildid,[closedbyid] => ^posts.closedbyid,[upvotes] => ^posts.upvotes,[downvotes] => ^posts.downvotes,[netvotes] => ^posts.netvotes,[views] => ^posts.views,[hotness] => ^posts.hotness,[flagcount] => ^posts.flagcount,[title] => ^posts.title,[tags] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[userid] => ^posts.userid,[cookieid] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[points] => ^userpoints.points,[obasetype] => LEFT(cposts.type, 1),[ohidden] => INSTR(cposts.type, '_HIDDEN')>0,[opostid] => cposts.postid,[ouserid] => cposts.userid,[ocookieid] => cposts.cookieid,[oip] => INET_NTOA(cposts.createip),[otime] => UNIX_TIMESTAMP(cposts.created),[oflagcount] => cposts.flagcount),[autocolumn] => Array ([postid] => 1,[categoryid] => 1,[type] => 1,[acount] => 1,[selchildid] => 1,[closedbyid] => 1,[upvotes] => 1,[downvotes] => 1,[netvotes] => 1,[views] => 1,[hotness] => 1,[flagcount] => 1,[title] => 1,[tags] => 1,[userid] => 1,[cookieid] => 1,[points] => 1)),[8] => Array ([columns] => Array ([0] => ^posts.postid,[1] => ^posts.categoryid,[2] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[3] => ^posts.acount,[4] => ^posts.selchildid,[5] => ^posts.closedbyid,[6] => ^posts.upvotes,[7] => ^posts.downvotes,[8] => ^posts.netvotes,[9] => ^posts.views,[10] => ^posts.hotness,[11] => ^posts.flagcount,[12] => ^posts.title,[13] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[14] => ^posts.userid,[15] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[16] => ^userpoints.points,[obasetype] => LEFT(editposts.type, 1),[ohidden] => INSTR(editposts.type, '_HIDDEN')>0,[opostid] => editposts.postid,[ouserid] => editposts.lastuserid,[ocookieid] => editposts.cookieid,[oip] => INET_NTOA(editposts.lastip),[otime] => UNIX_TIMESTAMP(editposts.updated),[oflagcount] => editposts.flagcount,[oupdatetype] => editposts.updatetype,[oupdated] => UNIX_TIMESTAMP(editposts.updated)),[arraykey] => opostid,[source] => ^posts LEFT JOIN ^categories ON ^categories.categoryid=^posts.categoryid LEFT JOIN ^userpoints ON ^posts.userid=^userpoints.userid JOIN ^posts AS parentposts ON ^posts.postid=IF(LEFT(parentposts.type, 1)='Q', parentposts.postid, parentposts.parentid) JOIN ^posts AS editposts ON parentposts.postid=IF(LEFT(editposts.type, 1)='Q', editposts.postid, editposts.parentid) JOIN (SELECT postid FROM ^posts WHERE lastuserid=$ AND type IN ('Q', 'A', 'C') ORDER BY updated DESC LIMIT #) y ON editposts.postid=y.postid WHERE parentposts.type IN ('Q', 'A', 'C') AND ^posts.type IN ('Q', 'A', 'C'),[arguments] => Array ([0] => 2,[1] => 50),[sortdesc] => otime,[outcolumns] => Array ([postid] => ^posts.postid,[categoryid] => ^posts.categoryid,[type] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[acount] => ^posts.acount,[selchildid] => ^posts.selchildid,[closedbyid] => ^posts.closedbyid,[upvotes] => ^posts.upvotes,[downvotes] => ^posts.downvotes,[netvotes] => ^posts.netvotes,[views] => ^posts.views,[hotness] => ^posts.hotness,[flagcount] => ^posts.flagcount,[title] => ^posts.title,[tags] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[userid] => ^posts.userid,[cookieid] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[points] => ^userpoints.points,[obasetype] => LEFT(editposts.type, 1),[ohidden] => INSTR(editposts.type, '_HIDDEN')>0,[opostid] => editposts.postid,[ouserid] => editposts.lastuserid,[ocookieid] => editposts.cookieid,[oip] => INET_NTOA(editposts.lastip),[otime] => UNIX_TIMESTAMP(editposts.updated),[oflagcount] => editposts.flagcount,[oupdatetype] => editposts.updatetype,[oupdated] => UNIX_TIMESTAMP(editposts.updated)),[autocolumn] => Array ([postid] => 1,[categoryid] => 1,[type] => 1,[acount] => 1,[selchildid] => 1,[closedbyid] => 1,[upvotes] => 1,[downvotes] => 1,[netvotes] => 1,[views] => 1,[hotness] => 1,[flagcount] => 1,[title] => 1,[tags] => 1,[userid] => 1,[cookieid] => 1,[points] => 1)),[pending_navpages] => Array ([columns] => Array ([0] => pageid,[1] => title,[2] => flags,[permit] => permit+0,[3] => nav,[4] => tags,[5] => position,[6] => heading),[arraykey] => pageid,[sortasc] => position,[source] => ^pages WHERE nav IN ($) ORDER BY position,[arguments] => Array ([0] => Array ([0] => B,[1] => M,[2] => O,[3] => F)),[outcolumns] => Array ([pageid] => pageid,[title] => title,[flags] => flags,[permit] => permit+0,[nav] => nav,[tags] => tags,[position] => position,[heading] => heading),[autocolumn] => Array ([pageid] => 1,[title] => 1,[flags] => 1,[nav] => 1,[tags] => 1,[position] => 1,[heading] => 1)),[pending_widgets] => Array ([columns] => Array ([0] => widgetid,[1] => place,[2] => position,[3] => tags,[4] => title),[source] => ^widgets ORDER BY position,[sortasc] => position,[outcolumns] => Array ([widgetid] => widgetid,[place] => place,[position] => position,[tags] => tags,[title] => title),[autocolumn] => Array ([widgetid] => 1,[place] => 1,[position] => 1,[tags] => 1,[title] => 1)))) called at [/var/www/otvety.sim-portal.ru/qa-include/qa-db-selects.php:58] #4 qa_db_select_with_pending(, , , Array ([columns] => Array ([0] => points,[1] => qposts,[2] => aposts,[3] => cposts,[4] => aselects,[5] => aselecteds,[6] => qupvotes,[7] => qdownvotes,[8] => aupvotes,[9] => adownvotes,[10] => qvoteds,[11] => avoteds,[12] => upvoteds,[13] => downvoteds,[14] => bonus),[source] => ^userpoints WHERE userid=$,[arguments] => Array ([0] => 2),[single] => 1), Array ([columns] => Array ([rank] => 1+COUNT(*)),[source] => ^userpoints WHERE points>COALESCE((SELECT points FROM ^userpoints WHERE userid=$), 0),[arguments] => Array ([0] => 2),[arrayvalue] => rank,[single] => 1), Array ([columns] => Array ([0] => ^posts.postid,[1] => ^posts.categoryid,[2] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[3] => ^posts.acount,[4] => ^posts.selchildid,[5] => ^posts.closedbyid,[6] => ^posts.upvotes,[7] => ^posts.downvotes,[8] => ^posts.netvotes,[9] => ^posts.views,[10] => ^posts.hotness,[11] => ^posts.flagcount,[12] => ^posts.title,[13] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[14] => ^posts.userid,[15] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[16] => ^userpoints.points),[arraykey] => postid,[source] => ^posts LEFT JOIN ^categories ON ^categories.categoryid=^posts.categoryid LEFT JOIN ^userpoints ON ^posts.userid=^userpoints.userid WHERE ^posts.userid=$ AND type='Q' ORDER BY ^posts.created DESC LIMIT #,[arguments] => Array ([0] => 2,[1] => 20),[sortdesc] => created), Array ([columns] => Array ([0] => ^posts.postid,[1] => ^posts.categoryid,[2] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[3] => ^posts.acount,[4] => ^posts.selchildid,[5] => ^posts.closedbyid,[6] => ^posts.upvotes,[7] => ^posts.downvotes,[8] => ^posts.netvotes,[9] => ^posts.views,[10] => ^posts.hotness,[11] => ^posts.flagcount,[12] => ^posts.title,[13] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[14] => ^posts.userid,[15] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[16] => ^userpoints.points,[obasetype] => LEFT(aposts.type, 1),[ohidden] => INSTR(aposts.type, '_HIDDEN')>0,[opostid] => aposts.postid,[ouserid] => aposts.userid,[ocookieid] => aposts.cookieid,[oip] => INET_NTOA(aposts.createip),[otime] => UNIX_TIMESTAMP(aposts.created),[oflagcount] => aposts.flagcount),[arraykey] => opostid,[source] => ^posts LEFT JOIN ^categories ON ^categories.categoryid=^posts.categoryid LEFT JOIN ^userpoints ON ^posts.userid=^userpoints.userid JOIN ^posts AS aposts ON ^posts.postid=aposts.parentid JOIN (SELECT postid FROM ^posts WHERE userid=$ AND type='A' ORDER BY created DESC LIMIT #) y ON aposts.postid=y.postid WHERE ^posts.type='Q',[arguments] => Array ([0] => 2,[1] => 50),[sortdesc] => otime), Array ([columns] => Array ([0] => ^posts.postid,[1] => ^posts.categoryid,[2] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[3] => ^posts.acount,[4] => ^posts.selchildid,[5] => ^posts.closedbyid,[6] => ^posts.upvotes,[7] => ^posts.downvotes,[8] => ^posts.netvotes,[9] => ^posts.views,[10] => ^posts.hotness,[11] => ^posts.flagcount,[12] => ^posts.title,[13] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[14] => ^posts.userid,[15] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[16] => ^userpoints.points,[obasetype] => LEFT(cposts.type, 1),[ohidden] => INSTR(cposts.type, '_HIDDEN')>0,[opostid] => cposts.postid,[ouserid] => cposts.userid,[ocookieid] => cposts.cookieid,[oip] => INET_NTOA(cposts.createip),[otime] => UNIX_TIMESTAMP(cposts.created),[oflagcount] => cposts.flagcount),[arraykey] => opostid,[source] => ^posts LEFT JOIN ^categories ON ^categories.categoryid=^posts.categoryid LEFT JOIN ^userpoints ON ^posts.userid=^userpoints.userid JOIN ^posts AS parentposts ON ^posts.postid=(CASE parentposts.type WHEN 'A' THEN parentposts.parentid ELSE parentposts.postid END) JOIN ^posts AS cposts ON parentposts.postid=cposts.parentid JOIN (SELECT postid FROM ^posts WHERE userid=$ AND type='C' ORDER BY created DESC LIMIT #) y ON cposts.postid=y.postid WHERE ^posts.type='Q' AND parentposts.type IN ('Q', 'A'),[arguments] => Array ([0] => 2,[1] => 50),[sortdesc] => otime), Array ([columns] => Array ([0] => ^posts.postid,[1] => ^posts.categoryid,[2] => ^posts.type,[basetype] => LEFT(^posts.type, 1),[hidden] => INSTR(^posts.type, '_HIDDEN')>0,[3] => ^posts.acount,[4] => ^posts.selchildid,[5] => ^posts.closedbyid,[6] => ^posts.upvotes,[7] => ^posts.downvotes,[8] => ^posts.netvotes,[9] => ^posts.views,[10] => ^posts.hotness,[11] => ^posts.flagcount,[12] => ^posts.title,[13] => ^posts.tags,[created] => UNIX_TIMESTAMP(^posts.created),[categoryname] => ^categories.title,[categorybackpath] => ^categories.backpath,[14] => ^posts.userid,[15] => ^posts.cookieid,[createip] => INET_NTOA(^posts.createip),[16] => ^userpoints.points,[obasetype] => LEFT(editposts.type, 1),[ohidden] => INSTR(editposts.type, '_HIDDEN')>0,[opostid] => editposts.postid,[ouserid] => editposts.lastuserid,[ocookieid] => editposts.cookieid,[oip] => INET_NTOA(editposts.lastip),[otime] => UNIX_TIMESTAMP(editposts.updated),[oflagcount] => editposts.flagcount,[oupdatetype] => editposts.updatetype,[oupdated] => UNIX_TIMESTAMP(editposts.updated)),[arraykey] => opostid,[source] => ^posts LEFT JOIN ^categories ON ^categories.categoryid=^posts.categoryid LEFT JOIN ^userpoints ON ^posts.userid=^userpoints.userid JOIN ^posts AS parentposts ON ^posts.postid=IF(LEFT(parentposts.type, 1)='Q', parentposts.postid, parentposts.parentid) JOIN ^posts AS editposts ON parentposts.postid=IF(LEFT(editposts.type, 1)='Q', editposts.postid, editposts.parentid) JOIN (SELECT postid FROM ^posts WHERE lastuserid=$ AND type IN ('Q', 'A', 'C') ORDER BY updated DESC LIMIT #) y ON editposts.postid=y.postid WHERE parentposts.type IN ('Q', 'A', 'C') AND ^posts.type IN ('Q', 'A', 'C'),[arguments] => Array ([0] => 2,[1] => 50),[sortdesc] => otime), ) called at [/var/www/otvety.sim-portal.ru/qa-include/qa-page-user.php:74] #5 require(/var/www/otvety.sim-portal.ru/qa-include/qa-page-user.php) called at [/var/www/otvety.sim-portal.ru/qa-include/qa-page.php:195] #6 qa_get_request_content() called at [/var/www/otvety.sim-portal.ru/qa-include/qa-page.php:758] #7 require(/var/www/otvety.sim-portal.ru/qa-include/qa-page.php) called at [/var/www/otvety.sim-portal.ru/qa-include/qa-index.php:164] #8 require(/var/www/otvety.sim-portal.ru/qa-include/qa-index.php) called at [/var/www/otvety.sim-portal.ru/index.php:35]

Question2Answer query failed:

(SELECT '3' AS selectkey, points, qposts, aposts, cposts, aselects, aselecteds, qupvotes, qdownvotes, aupvotes, adownvotes, qvoteds, avoteds, upvoteds, downvoteds, bonus, NULL AS rank, NULL AS postid, NULL AS categoryid, NULL AS type, NULL AS basetype, NULL AS hidden, NULL AS acount, NULL AS selchildid, NULL AS closedbyid, NULL AS upvotes, NULL AS downvotes, NULL AS netvotes, NULL AS views, NULL AS hotness, NULL AS flagcount, NULL AS title, NULL AS tags, NULL AS created, NULL AS categoryname, NULL AS categorybackpath, NULL AS userid, NULL AS cookieid, NULL AS createip, NULL AS obasetype, NULL AS ohidden, NULL AS opostid, NULL AS ouserid, NULL AS ocookieid, NULL AS oip, NULL AS otime, NULL AS oflagcount, NULL AS oupdatetype, NULL AS oupdated, NULL AS pageid, NULL AS flags, NULL AS permit, NULL AS nav, NULL AS position, NULL AS heading, NULL AS widgetid, NULL AS place FROM qa_userpoints WHERE userid='2') UNION ALL (SELECT '4', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1+COUNT(*), 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, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_userpoints WHERE points>COALESCE((SELECT points FROM qa_userpoints WHERE userid='2'), 0)) UNION ALL (SELECT '5', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid WHERE qa_posts.userid='2' AND type='Q' ORDER BY qa_posts.created DESC LIMIT 20) UNION ALL (SELECT '6', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(aposts.type, 1), INSTR(aposts.type, '_HIDDEN')>0, aposts.postid, aposts.userid, aposts.cookieid, INET_NTOA(aposts.createip), UNIX_TIMESTAMP(aposts.created), aposts.flagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS aposts ON qa_posts.postid=aposts.parentid JOIN (SELECT postid FROM qa_posts WHERE userid='2' AND type='A' ORDER BY created DESC LIMIT 50) y ON aposts.postid=y.postid WHERE qa_posts.type='Q') UNION ALL (SELECT '7', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(cposts.type, 1), INSTR(cposts.type, '_HIDDEN')>0, cposts.postid, cposts.userid, cposts.cookieid, INET_NTOA(cposts.createip), UNIX_TIMESTAMP(cposts.created), cposts.flagcount, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=(CASE parentposts.type WHEN 'A' THEN parentposts.parentid ELSE parentposts.postid END) JOIN qa_posts AS cposts ON parentposts.postid=cposts.parentid JOIN (SELECT postid FROM qa_posts WHERE userid='2' AND type='C' ORDER BY created DESC LIMIT 50) y ON cposts.postid=y.postid WHERE qa_posts.type='Q' AND parentposts.type IN ('Q', 'A')) UNION ALL (SELECT '8', qa_userpoints.points, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, qa_posts.postid, qa_posts.categoryid, qa_posts.type, LEFT(qa_posts.type, 1), INSTR(qa_posts.type, '_HIDDEN')>0, 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), qa_categories.title, qa_categories.backpath, qa_posts.userid, qa_posts.cookieid, INET_NTOA(qa_posts.createip), LEFT(editposts.type, 1), INSTR(editposts.type, '_HIDDEN')>0, editposts.postid, editposts.lastuserid, editposts.cookieid, INET_NTOA(editposts.lastip), UNIX_TIMESTAMP(editposts.updated), editposts.flagcount, editposts.updatetype, UNIX_TIMESTAMP(editposts.updated), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_posts LEFT JOIN qa_categories ON qa_categories.categoryid=qa_posts.categoryid LEFT JOIN qa_userpoints ON qa_posts.userid=qa_userpoints.userid JOIN qa_posts AS parentposts ON qa_posts.postid=IF(LEFT(parentposts.type, 1)='Q', parentposts.postid, parentposts.parentid) JOIN qa_posts AS editposts ON parentposts.postid=IF(LEFT(editposts.type, 1)='Q', editposts.postid, editposts.parentid) JOIN (SELECT postid FROM qa_posts WHERE lastuserid='2' AND type IN ('Q', 'A', 'C') ORDER BY updated DESC LIMIT 50) y ON editposts.postid=y.postid WHERE parentposts.type IN ('Q', 'A', 'C') AND qa_posts.type IN ('Q', 'A', 'C')) UNION ALL (SELECT 'pending_navpages', 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, title, tags, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, pageid, flags, 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, NULL, NULL, 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 MySQL server version for the right syntax to use near 'rank, NULL AS postid, NULL AS categoryid, NULL AS type, NULL AS basetype, NULL A' at line 1