購物車研究站-討論區首頁 |
說明 搜尋 會員 日曆 |
cct0201 |
發表於: 2006-07-09, 07:49 PM
|
新進會員 所屬群組: 註冊會員 發表總數: 6 會員編號: 7397 註冊日期: -- |
mysql error: [1054: Unknown column 'p.manufacturers_id' in 'on clause'] in EXECUTE("select count(distinct p.products_id) as total from products p, categories c, products_to_categories p2c left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' where c.categories_status=1 and p.products_id = p2c.products_id and c.categories_id = p2c.categories_id and products_status = '1' order by p.products_date_added DESC")
Fatal error: mysql error: [1054: Unknown column 'p.manufacturers_id' in 'on clause'] in EXECUTE("select count(distinct p.products_id) as total from products p, categories c, products_to_categories p2c left join manufacturers m on p.manufacturers_id = m.manufacturers_id left join products_description pd on p.products_id = pd.products_id and pd.language_id = '1' where c.categories_status=1 and p.products_id = p2c.products_id and c.categories_id = p2c.categories_id and products_status = '1' order by in e:\appserv\www\twecommerce\includes\classes\adodb\adodb-errorhandler.inc.php on line 149 每次要進入新進商品時,就會看到沒有p.manufacturers_id這個欄位的錯 可是我檢查資料庫應該是有 不知道為什麼會這樣 請前輩們幫我看一下囉 謝謝 |
cheneric |
發表於: 2007-02-09, 05:01 PM
|
進階會員 所屬群組: 註冊會員 發表總數: 388 會員編號: 4288 註冊日期: -- |
參考一下kiss2000大大在KMD提出的解決方式
http://www.kmd.com.tw/Forum/viewtopic.php?...=Unknown+column MySQL 5.x 上出現有關 Left Join 的問題時, 可以下列方法來解決。 Select 句子有一個 Left Join 時: 1. 在 From 後面加上一個 ( 2. 在 Left join 前加上一個 ) Select 句子有兩個 Left Join 時: 1. 在 From 後面加上 (( 2. 在第一個 Left join 前加上一個 ) 3. 在第兩個 Left join 前加上一個 ) 答案在 OScommerce 的網站上: http://www.oscommerce.com/community/bugs,3259/search,mysql ------------------------------------------- Here is my suggestion to correct this 1054 Error with Left join : 1. I give you the tips : every time you see a FROM followed by 1 or more LEFT JOIN, proceed like this : ONE LEFT JOIN : a. after the FROM add ( before the LEFT JOIN add ) TWO LEFT JOIN : b. after the FROM add (( before the 1st LEFT JOIN add ) before the 2nd LEFT JOIN add ) |