3
con = sqlite3.connect("mydb")
3
con = sqlite3.connect(":memory:")
5
cur.execute("create table people (name_last, age)")
10
cur.execute("select name_last, age from people where name_last=? and age=?", (who, age))
10
# This is the qmark style:
11
cur.execute("insert into people values (?, ?)", (who, age))
13
# And this is the named style:
14
cur.execute("select * from people where name_last=:who and age=:age", {"who": who, "age": age})
11
16
print(cur.fetchone())