0

It is showing an error in SQL syntax:

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

Code:

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)
ekhumoro
  • 115,249
  • 20
  • 229
  • 336

0 Answers0