Skip to main content
Known Participant
December 21, 2007
Question

MySQL Error#: 1054 Unknown column 'colname' in 'on clause'

  • December 21, 2007
  • 1 reply
  • 1666 views
In DW9 Advanced query edit window - adding a variable (default name colname) to the query

SELECT *
FROM question_qst LEFT JOIN response_rsp ON response_rsp.fk_id_qst_rsp =question_qst.id_qst AND response_rsp.fk_id_src_rsp = colname
ORDER BY question_qst.id_qst

this runs fine as a TEST and the PAGE runs OK
but selecting the recordset in the binding panel - causes the error to pop up
MySQL Error#: 1054 Unknown column 'colname' in 'on clause'
and no values to be listed under the Recordset

I've also looked at the MYSQL pages on JOINS with mention of using () around each JOIN - but that made no difference

Is this a bug - or user error?

regards

Paul

PS

Solution (FOR NOW) - get the variable directly
SELECT *
FROM question_qst LEFT JOIN response_rsp ON response_rsp.fk_id_qst_rsp =question_qst.id_qst AND response_rsp.fk_id_src_rsp ='".$_GET["id_src"]."'
ORDER BY question_qst.id_qst
This topic has been closed for replies.

1 reply

Known Participant
April 5, 2016

I have the same problem.

After a long search I found your workaround and it works great.

Thanks for posting it.

Tony