I am trying to insert a string into a SQL table, but the string value is blank after the insert. What am I doing wrong and what should I do to fix it?
This is the python function I am running.
def newCharacter(usr):
cur.execute("INSERT INTO stats (user, level, exp, hp, attack, luck, aggro, hpregen) VALUES ('{}', 1, 0, 100, 10, 50, 50, 0)".format(usr))
Below is an example of my stats table after inserting two rows using the above newCharacter function. The first column (which is blank below) should contain a string (e.g. "Username").
| 1 | 0 | 100 | 10 | 50 | 50 | 0 |
| 1 | 0 | 100 | 10 | 50 | 50 | 0 |
cursor.commit()usr?