使用PHP和MySQL获取值时获取错误

时间:2017-01-16 07:31:50

标签: php mysql

从表中获取值时,我收到以下错误。

  

1054 - 未知专栏' frmDay'在' on子句'

我在下面解释我的问题。

$sql="select sl.image_id, sl.member_id, sl.subcat_id, sl.date_from, sl.date_to, 
min(sl.from_day) as frmDay, max(sl.to_day) as toDay, sl.image, b.rest_name, 
b.member_id, s.subcat_name, s.subcat_id, d1.day_name as from_day_name, 
d1.day_id, d2.day_name as to_day_name, d2.day_id 
from db_special_images as sl 
left join db_subcategory as s on sl.subcat_id=s.subcat_id 
left join db_restaurant_basic as b on sl.member_id=b.member_id 
left join db_day as d1 on d1.day_id=frmDay 
left join db_day as d2 on d2.day_id=toDay  
group by sl.member_id, sl.subcat_id 
order by sl.image_id desc";

请帮我解决此错误。

0 个答案:

没有答案