This is my code:
conn = sqlite3.connect(nnpcconfig.commondb)
cur = conn.cursor()
query = ['2124124', 'test2', 'test3', 'test4', 'test5']
cur.execute("insert into users(id, encpass, sname, name, fname) values (?, ?, ?, ?, ?)", query)
conn.commit
cur.execute("select * from users")
for row in cur:
print row
This code works, returning row fed to it. But it comes out that once script terminated, table is clear again! Where’s the mistake? Of course, table users exists.
You have another mistake:
conn.commitinstead ofconn.commit()