I have an entry field for a last name and am using .get() to grab the data. If I enter the name 'Jones' into the field and submit it, I get this error:
OperationalError: (1054, "Unknown column 'Jones' in 'field list'")
If I move the quotes around I won't get an error message but it also won't show up in the database.
Manually:
Expand|Select|Wrap|Line Numbers
- mysql>INSERT INTO persons (lname) VALUES ("Jones");
- Query OK, 1 row affected (0.36 sec)
Expand|Select|Wrap|Line Numbers
- test4=win4a.get() # Last name
- cursor.execute("INSERT INTO persons (lname) VALUE (%s)"% (test4))
Expand|Select|Wrap|Line Numbers
- cursor.execute("INSERT INTO persons (lname) VALUE ('%s')"% (test4))
Expand|Select|Wrap|Line Numbers
- cursor.execute("INSERT INTO persons (lname) VALUE ('Jones')")