存在未知列的MySQL警告

时间:2009-07-19 19:17:31

标签: php mysql sql mysql-error-1054

找到了如何找到PHP问题。我现在正在努力解决这些问题,但我对这个问题一无所知。

我使用了mysql_error,我找到了:

1054: Unknown column 'o.user_id' in 'on clause' 

这有什么问题:

$sql="SELECT o.*, u.user_name, u.email, od.artist_id,cm.nexchange_price

         FROM ".$tableprefix."orders o,".$tableprefix."currency_master cm

        INNER JOIN ".$tableprefix."users u ON o.user_id = u.user_id

        INNER JOIN ".$tableprefix."order_details od ON o.order_id = od.order_id

        WHERE o.order_id = ".GetSQLValueString($orderid,"text")."

         AND o.vorder_currency = cm.vcurrency_code ".$qryopt . " ORDER BY o.order_date DESC";

该列存在于订单表中?!

1 个答案:

答案 0 :(得分:6)

“订单o”后面有逗号,表示您尝试将currency_master表加入users表,而不是orders和{{1} }。我想你想要:

users