Forums

Sqlite3 cant find table

I have a sqlite database called test.db that I want to access, however when running my code in python, it cannot find the table users:

con = sqlite3.connect("/home/pufferfish/mysite/test.db")
cur = con.cursor()
cur.execute("INSERT INTO users VALUES (?,?,?)", [user_count+1, request.form['username'].lower(),request.form['password']])
con.commit()
cur.close()
con.close()

The database file is loaded correctly and the users table exists as I can see it when I access the database using the same file path in bash. How can i fix this?

Are you sure you're using the same database in both cases?