I know this has been discussed a couple of times but following the suggestions provided still did not solve my problem.
I tried to reproduce a youtube tutorial on updating a table:
Code: Part1:
cursor.execute("CREATE DATABASE testdab")
cursor.execute("CREATE TABLE users (name VARCHAR(255), email VARCHAR(255), age INTEGER(10), user_id INTEGER AUTO_INCREMENT PRIMARY KEY)")
Part2:
insert_query = "INSERT INTO users (name, email, age) VALUES (%s, %s, %s)",
record1 = ("Peter", "[email protected]", 30)
cursor.execute(insert_query, record1)
The table is successfully created, but Part2 throws error message: AttributeError: 'tuple' object has no attribute 'encode'
Anyone having an idea what's going wrong here? Many thanks, Thomas