List:MySQL and PHP« Previous MessageNext Message »
From:chenzen chenzen Date:May 5 2008 7:22pm
Subject:unknow column error
View as plain text  
hi,
  i am getting this error
           1054 - Unknown column 'point_rele' in 'order clause'
  when calling the following query from PHP
           select p.products_image, pd.products_name,
p.products_date_available, p.products_date_added, p.products_tba,
m.manufacturers_name, p.products_ordered, pef.actors, pef.directors,
pef.video, pef.audio, pef.subtitles, pef.rating, pef.region, pef.length,
pef.type, pt.product_types_name AS type, p.products_id, p.manufacturers_id,
p.products_price, IF(s.status, s.specials_new_products_price, NULL) as
specials_new_products_price, IF(s.status, s.specials_new_products_price,
p.products_price) as final_price , IF(CURDATE() > p.products_date_added and
p.products_date_added > DATE_ADD(CURDATE(), INTERVAL -30
DAY),'true','false') AS point_rele from products_description pd, products p
left join specials s on p.products_id = s.products_id left join
manufacturers m on p.manufacturers_id = m.manufacturers_id,
products_to_categories p2c left join products_extra_fields pef on
p.products_id = pef.products_id , product_types pt where
p.product_types_id=pt.product_types_id and pt.product_types_id=1 and
p.products_status = '1' and p.products_id = p2c.products_id and
pd.products_id = p2c.products_id and pd.language_id = '1' and
p2c.categories_id = '4' order by FIELD(point_rele, 'true', 'false'),
p.products_date_added desc, p.products_tba desc, p.products_date_added desc,
pd.products_name limit 0, 20

    I will appreciate your kind help. thanks.

Thread
unknow column errorchenzen chenzen5 May 2008