Welcome to WebmasterWorld Guest from 23.22.182.29

Forum Moderators: open

Message Too Old, No Replies

Error Message from MySQL

     
2:21 pm on Sep 20, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2005
posts:392
votes: 0


What is the problem with this


SELECT itemmaster_list.*, category_lists.cid as categoryID, category_lists.displayed_text as categoryName, brand_lists.cid as brandID, brand_lists.displayed_text as brandName, brand_lists.image1 as brandImage, brand_lists.cid_text as brandTextCode,
CASE WHEN items_specialprices.itemprice IS NULL
THEN itemmaster_list.default_price
ELSE items_specialprices.itemprice
END as finalprice
FROM itemmaster_list, category_lists, brand_lists
LEFT JOIN items_specialprices ON items_specialprices.itemcode = itemmaster_list.cid
AND items_specialprices.username = 'UserS'
WHERE itemmaster_list.status = 'ACTIVE' AND itemmaster_list.cid = '99' AND category_lists.cid = itemmaster_list.categorycode AND brand_lists.cid = itemmaster_list.brandcode


Im getting an error "#1054 - Unknown column 'itemmaster_list.cid' in 'on clause'" but im sure field 'cid' exist in table 'itemmaster_list'
4:12 pm on Sept 20, 2012 (gmt 0)

Preferred Member

10+ Year Member

joined:Nov 25, 2005
posts:392
votes: 0


Problem Solved using LEFT JOIN