##1054:Unknown column 'a.first_letter' in 'where Clause'
但資料表有first_letter這個欄位的
[ SQL語句 ] : SELECT a.id AS vod_id, a.classid AS vod_classid, a .name AS vod_name、a.pic_url AS vod_pic_url、a.definition AS vod_definition、a.movie_type AS vod_movie_type、b.price AS vod_price、c.pay_flag AS vod_pay_flag FROM vod a LEFT ROMod = a .id LEFT JOIN vod_pay_log AS c ON c.pay_vod_id = a.id AND c.checkin_id = ''WHERE a.status = 1 AND a.classid =1 AND a.first_letter like 'A%' ORDER BY a.sortDER BY a.sortDER BY a. , a .id DESC
##
歪個樓,通常不要使用sql拼接,因為這樣會讓攻擊者可以SQL注入。最好是使用框架帶的MODEL層,或是自己寫。
你可以試試把
a.first_letter
放到查询字段里面,记得好像5.7
版本之后的sql,查询条件字段必须在select
裡面有查出來.也可以透過修改my.cnf避免這個.desc vod;