What's wrong with my SQL Statement in python? [closed]

91
June 14, 2021, at 03:20 AM
Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 7 hours ago.

Improve this question

I'm having trouble updating a Highscore which is in a database with a variable value in python.

Both variables definitely have a value (points and loginUser), so I'm not sure where the problem was. It used to work before, but in previous versions it seems to also have errors attached. Any help would be great :)

Extra Information: Basically, it displays the 'new score' in the tkinter GUI, but does not import it into the database.

cursor.execute("UPDATE usertable SET Highscore = ? WHERE Users = ?", (points, loginUser)) # Executes this SQL Statement to update the Highscore field in the usertable with the new score #
        conn.commit # Commits the SQL Statement #
Answer 1

conn.commit() is the answer. You need to add a () to call the function. Without it, you are just referencing the commit function. It won't do anything

READ ALSO
Change ID and Class by click

Change ID and Class by click

i'm creating visual configurator for a car and wheels

54
Set up a SQL query with multiple AS

Set up a SQL query with multiple AS

I have a table called visits, which has columns source, statesource is string and state is boolean

50
Is it possible to not rebuild the whole app but generate new static files only in Nextjs?

Is it possible to not rebuild the whole app but generate new static files only in Nextjs?

I've just started using NextJs getStaticProps, and static files generated at build time is neatBut my contents just don't stay unchanged, I need static files to be updated but rebuilding the app everytime there's a modification is costly

86
The file i have mentioned is not getting downloaded even if I have used the download function properly in the express.js

The file i have mentioned is not getting downloaded even if I have used the download function properly in the express.js

The top image is my js code and the second two is the dowbload lin kand the error i am getting]1

49