0

I'm trying to retrieve data from MySQL table and showing the result in Tkinter label

    sql=("SELECT fname,lname,ID from students_details where fname = %s")  
    val=(name)
    mycursor.execute(sql,val)
    results = mycursor.fetchall()
    mydb.commit()
    mydb.close()

    l2=Label(top3, text = '{}Your attendance has been recorded'.format(results),font=("Helvetica", 14),bg='#BFD5ED')
    l2.place(relx=0.5,rely=0.10,anchor =S)

The error i got isCould not process parameters

Any ideas or suggestions will be helpful!!

stovfl
  • 14,998
  • 7
  • 24
  • 51
Albandry
  • 15
  • 3
  • Post the full traceback as it contains which line causing the problem. Also no need to call commit() for SELECT statement. Your code seems to expect at most one record returned, so better use fetchone() instead. – acw1668 Mar 16 '20 at 00:50
  • Try changing `val=(name)` to `val=(name,)`. – acw1668 Mar 16 '20 at 01:50

0 Answers0