为什么显示1064(42000):您的SQL语法有错误?

时间:2017-11-23 18:40:23

标签: python mysql

它在SQL语法中显示错误:

1064 (42000): You have an error in your SQL syntax; check the manual
that corresponds to your MySQL server version for the right syntax to
use near '%s' at line 1

代码:

if(options==2):
    query = ("SELECT Sl_NO,Title,Genre FROM dvdstore WHERE Genre = %s")
    genre_type = raw_input("Enter the type of genre: ")
    print genre_type
    try:
        y=x.execute(query,(genre_type))
        print y 
        for (Sl_NO,Title,Genre) in x:
            print Title

    except Error as error:
        print(error)

0 个答案:

没有答案