Answer the question
In order to leave comments, you need to log in
How to insert parameters into SQL query?
How to insert the variables presented above instead of the words (James', 25, 'male', 'USA) here is the source code
jo = 'users228'
name = 'James'
age = '25'
male = 'male'
counre = 'USA'
cursor.execute("""
INSERT INTO
{} (title, age, gender, nationality)
VALUES
('James', 25, 'male', 'USA');
""".format(jo))
conn.commit()
Answer the question
In order to leave comments, you need to log in
Something like this:
cursor.execute("""INSERT INTO название_таблици (title, age, gender, nationality) VALUES(?,?,?,?)""",(name, age, male, counre, ))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question