Heim  >  Fragen und Antworten  >  Hauptteil

PHP – SQL-Anweisungs-Splicing-Fehlerbericht

1054:Unbekannte Spalte „a.first_letter“ in „where-Klausel“ 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> ;

天蓬老师天蓬老师2706 Tage vor716

Antworte allen(3)Ich werde antworten

  • PHP中文网

    PHP中文网2017-05-24 11:36:31

    歪个楼,一般不要使用sql拼接,因为这样会使攻击者可以SQL注入。最好使用框架带的MODEL层,或者自己写。

    Antwort
    0
  • 巴扎黑

    巴扎黑2017-05-24 11:36:31

    你可以试下把a.first_letter放到查询字段里面,记得好像5.7版本之后的sql,查询条件字段必须在select里面有查出来.也可以通过修改my.cnf避免这个.

    Antwort
    0
  • 给我你的怀抱

    给我你的怀抱2017-05-24 11:36:31

    desc vod;

    Antwort
    0
  • StornierenAntwort