Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Is this a known problem ?

0 votes
1,311 views
asked Aug 29, 2011 in Q2A Core by renato

Loggued as admin

on this page : /forum/admin/categories

I have this

Question2Answer query failed:

(SELECT '0' AS selectkey, qa_categories.categoryid, qa_categories.parentid, BINARY qa_categories.title AS title, BINARY qa_categories.tags AS tags, qa_categories.qcount, qa_categories.position, COUNT(child.categoryid) AS childcount, BINARY qa_categories.content AS content, BINARY qa_categories.backpath AS backpath, NULL AS pageid, NULL AS flags, NULL AS nav, NULL AS widgetid, NULL AS place FROM qa_categories JOIN (SELECT NULL AS parentkey UNION SELECT grandparent.parentid FROM qa_categories JOIN qa_categories AS parent ON qa_categories.parentid=parent.categoryid JOIN qa_categories AS grandparent ON parent.parentid=grandparent.categoryid WHERE qa_categories.categoryid=NULL UNION SELECT parent.parentid FROM qa_categories JOIN qa_categories AS parent ON qa_categories.parentid=parent.categoryid WHERE qa_categories.categoryid=NULL UNION SELECT parentid FROM qa_categories WHERE categoryid=NULL UNION SELECT categoryid FROM qa_categories WHERE categoryid=NULL) y ON parentid<=>parentkey LEFT JOIN qa_categories AS child ON child.parentid=qa_categories.categoryid GROUP BY qa_categories.categoryid ORDER BY qa_categories.position) UNION ALL (SELECT '_options', NULL, NULL, title, NULL, NULL, NULL, NULL, BINARY content, NULL, NULL, NULL, NULL, NULL, NULL FROM qa_options) UNION ALL (SELECT '_time', NULL, NULL, NULL, NULL, NULL, NULL, NULL, UNIX_TIMESTAMP(NOW()), NULL, NULL, NULL, NULL, NULL, NULL) UNION ALL (SELECT '_navpages', NULL, NULL, BINARY title, BINARY tags, NULL, position, NULL, NULL, NULL, pageid, flags, nav, NULL, NULL FROM qa_pages WHERE nav IN (_utf8 'B',_utf8 'M',_utf8 'O',_utf8 'F') ORDER BY position) UNION ALL (SELECT '_widgets', NULL, NULL, BINARY title, tags, NULL, position, NULL, NULL, NULL, NULL, NULL, NULL, widgetid, place FROM qa_widgets ORDER BY position)

Error 1052: Column 'parentid' in on clause is ambiguous

commented Aug 29, 2011 by snoopy0815
I've never seen this up to now...
is it a new installation from scratch without any plugins which are not part of the core?

1 Answer

+1 vote
answered Aug 30, 2011 by gidgreen
 
Best answer

Perhaps this is due to a bug in a specific version of MySQL.

In qa-db-selects.php, please try changing this phrase:

parentid<=>parentkey

... to ...

^categories.parentid<=>parentkey

commented Aug 30, 2011 by renato
Hello gidgreen,
thank you for your help.
The cahnge you suggested fixed the pbm.
For info this is are the versions :
- Apache 2.2.15
- MySQL 4.1.22-standard-log
- PHP 5.2.17
Cheers,
Renato
...