List:MySQL and PHP« Previous MessageNext Message »
From:chenzen chenzen Date:May 6 2008 1:34am
Subject:Fwd: unknow column error
View as plain text  
hi,
  nothing is problem with the tables. please assume that  all the necessary
columns are already there. it works perfect when i don't include
FIELD(point_rele, 'true', 'false'), in the "order by".
         regards,
        sunaram patir

---------- Forwarded message ----------
From: Dmitry Beloff <wildarp@stripped>
Date: Tue, May 6, 2008 at 3:05 AM
Subject: Re: unknow column error
To: chenzen chenzen <chenzenenator@stripped>


2008/5/5 chenzen chenzen <chenzenenator@stripped>:
> 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.
>

DESC your tables here

Thread
Fwd: unknow column errorchenzen chenzen6 May 2008