Hi,
When going into my workspace, I have the following php error:
[code]
user warning: Unknown column 'n.nid' in 'on clause' query: SELECT n.nid, n.uid, n.type, 0 AS cid, n.title, n.status, n.changed, s.comment_count, 1 AS node FROM min_node n LEFT JOIN min_node_comment_statistics s ON n.nid = s.nid WHERE n.uid = 1 UNION SELECT c.nid AS cnid, c.uid, "" AS type, c.cid, c.subject, c.status, c.timestamp, c.pid, 0 FROM min_node n, min_comments AS c LEFT JOIN min_node_comment_statistics s ON n.nid = s.nid WHERE c.uid = 1 ORDER BY changed DESC LIMIT 0, 50 in /homepages/23/d154239500/htdocs/min/includes/database.mysql.inc on line 124.
[/code]
I understand this SQL query, but it seems drupal does not recon the FROM min_node n statement, so for it, the table "n" does not exist.
What can I do?
Thanks
Comments
Comment #1
jvandyk commentedPlease provide the version of workspace that you are using (from line 2 of the module), the platform you are running on, and the version of Apache and MySQL.
Comment #2
Julien PHAM commentedSo, for the workspace module :
$Id: workspace.module,v 1.21 2005/12/12 04:25:10 jvandyk Exp $
MySQL v. 5 (don't know the exact version though).
And about apache, I don't know... My website is hosted by http://www.1and1.fr
How can I know the exact mysql and apache version?
Thanks
Comment #3
jvandyk commentedLooks like this is a problem related to new rules in the way MySQL 5 handles JOIN syntax. See the thread here and issues linked from that.
Comment #4
Julien PHAM commentedIndeed, I have done some testing, the first select query alone works, the second query does not work.
So let's work on the second query: originally it is like that:
SELECT c.nid AS cnid, c.uid, "" AS type, c.cid, c.subject, c.status, c.timestamp, c.pid, 0 FROM min_node n, min_comments AS c LEFT JOIN min_node_comment_statistics s ON n.nid = s.nid WHERE c.uid = 1 ORDER BY changed DESC LIMIT 0, 50
This query alone returns the n.nid error message.
I have tried changing the order of the tables, and so:
SELECT c.nid AS cnid, c.uid, "" AS type, c.cid, c.subject, c.status, c.timestamp, c.pid, 0 FROM min_comments AS c, min_node n LEFT JOIN min_node_comment_statistics s ON n.nid = s.nid WHERE c.uid = 1 ORDER BY changed DESC LIMIT 0, 50
And now it works.
It seems in mysql 5 (perhaps), as the select causes talks about c, we should put the c before the n... but I'm unsure of this, wonder why it does not work with the original query.
But now the problem is that I have no idea on how to fix this, and I cannot put my site online 'till this query works, I need the workspace...
Comment #5
jvandyk commentedFixed. Thanks.
Comment #6
(not verified) commented