How do i update my sql database phpmyadmin

Viewed 25

could someone help me with this? I'm struggling with this part of code I cant Update my database with this code Please Help me.

This is the code for my update #For Update

def update():
    databases = mysql.connector.connect(
    host ="localhost",
    user = "userdata",
    password = "",
    database = "facerecog"
    )
    conn = databases.cursor()
    conn.execute("UPDATE record SET names= %s, course_year= %s, positions= %s where ids = %s",(
        t31.get(),
        t4.get(),
        t5.get(),
        t6.get(),
    ))
    databases.commit()
updatebutton = tk.Button(t, text = "Update Data", command = update)
updatebutton.configure(font = ('Cooper', 13, 'bold'), bg = 'sky blue', fg = 'black')
updatebutton.place(x=560, y=400)

here's the photo enter image description here

0 Answers
Related