I have a very simple python script that I'm using. It can read items from a table, and I've tried the user seperately from the command line and it can read/write everything fine.
When I try to INSERT something into the table, the values don't stay, the cursor can read them until the connection is closed, but nothing else can and they just seem to go away. Is there something I'm misisng with al this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You realize that you should call it after your INSERT statement is invoked (with cursor.execute()) but before you close the database (db.close()), right? I code example is always helpful for diagnosing these problems.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have a very simple python script that I'm using. It can read items from a table, and I've tried the user seperately from the command line and it can read/write everything fine.
When I try to INSERT something into the table, the values don't stay, the cursor can read them until the connection is closed, but nothing else can and they just seem to go away. Is there something I'm misisng with al this?
Try calling db.commit() where db is your database connection object.
Hey
Nope that didn't have any affect on the database :(
I should add:
I'm running it on windows XP pro
mySQL 4.1
Python 2.4
You realize that you should call it after your INSERT statement is invoked (with cursor.execute()) but before you close the database (db.close()), right? I code example is always helpful for diagnosing these problems.
No I didn't actually, that did it!
Thank you so much.