php - sql statement splicing error report
天蓬老师
天蓬老师 2017-05-24 11:34:31
0
3
752

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 AS a LEFT JOIN vod_price AS b ON b.vod_id = 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.sort, a.id DESC</h1>

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

reply all(3)
Ty80

Heck, generally don’t use sql splicing, because this will allow attackers to inject SQL. It is best to use the MODEL layer provided by the framework, or write it yourself.

巴扎黑

You can try to find out a.first_letter放到查询字段里面,记得好像5.7版本之后的sql,查询条件字段必须在select. You can also avoid this by modifying my.cnf.

给我你的怀抱

desc vod;

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template