0

I have tried this code but i receive the 1064 error.

x_1=**********    
t_2=(x_1)
cursor.execute('insert into informations' '(password)' 'values (%s)',t_2)

1 Answer 1

1
cursor.execute('insert into informations (password) values (?)', (x_1,))

would be a better syntax.

Just one string including the whole statement and using a question mark as placeholder for the value to insert.

The most important is to define the single value into a tuple.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.