0
Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Program Files\Python37\lib\tkinter\__init__.py", line 1705, in __call__
    return self.func(*args)
  File "C:\Users\harsh\Desktop\index.py", line 33, in Login
    cursor.execute("SELECT * FROM `member` WHERE `username` = text AND `password` = ?", (USERNAME.get(), PASSWORD.get()))
  File "C:\Program Files\Python37\lib\site-packages\mysql\connector\cursor_cext.py", line 261, in execute
    "Not all parameters were used in the SQL statement")
mysql.connector.errors.ProgrammingError: Not all parameters were used in the SQL statement
karel
  • 5,489
  • 46
  • 45
  • 50

2 Answers2

0

try this:

cursor.execute("SELECT * FROM `member` WHERE `username` = %s AND `password` = %s", (USERNAME.get(), PASSWORD.get()))
Waket Zheng
  • 5,065
  • 2
  • 17
  • 30
0

You have an error in your sql execute query, you should know how to do string formatting very well if you are going to pass in your fields. For example, the code you wrote should've been written this way

query = "SELECT * FROM `member` WHERE `username` = {} AND 
`password` = {}".format (USERNAME.get(), PASSWORD.get())
cursor.execute(query)

Since you're writing the whole query in just one line, try and make adjustment using the above correction.

DevTotti
  • 86
  • 6