basic question that i haven't been able to find the exact solution for. i'm trying to insert a paramaters into customer table :
def cur():
db = sqlite3.connect("bookdb.sqlite")
cursor = db.cursor()
return cursor
def add_customer(id, name, city, age):
cursor = cur()
sql = f'insert into customer(id,name,city,age) VALUES({id}, {name}, {city}, {age})'
cursor.execute(sql)
cursor.connection.commit()
and when using :
add_customer(7, 'jimbo', 'NY', 22)
i get the following error:
sqlite3.OperationalError: no such column: jimbo
it appears to work fine when i only insert integers into the function but not strings, the name column exists and i'm unable to add any strings into it.