Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sqlite3
- conn = sqlite3.connect('users.db')
- c = conn.cursor()
- c.execute('''
- CREATE TABLE IF NOT EXISTS User(
- findex int primary key,
- username text,
- email text,
- preference text)
- ''')
- findex = 3
- username = "dichong"
- email = "dichong@gmail.com"
- preference = "111111"
- c.execute('''
- INSERT INTO User(findex,username,email,preference)VALUES(?,?,?,?)
- ''',(findex,username,email,preference))
- t = (3,)
- c.execute('SELECT * FROM User WHERE findex=?',t)
- print(c.fetchone())
- conn.commit()
- conn.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement