Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

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

Contributor ,
Dec 21, 2007 Dec 21, 2007

Copy link to clipboard

Copied

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
TOPICS
Server side applications

Views

1.6K
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 05, 2016 Apr 05, 2016

Copy link to clipboard

Copied

LATEST

I have the same problem.

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

Thanks for posting it.

Tony

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines