D
D
dexering2021-12-16 11:35:41
Python
dexering, 2021-12-16 11:35:41

Error in sql query with text with dot?

the code
conn = pymysql.connect(host=host, port=port, user=user, passwd=password, db=mydb)
cursor = conn.cursor()
cursor.execute("INSERT IGNORE INTO 'users' ('username', 'password', 'email') VALUES (%s, %s, %s)", (usernamee, passwordd, emaill))
conn.commit()


mistake
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''users' ('username', 'password', 'email') VALUES ('Dex', 'Dexx', '[email protected]' at line 1")


mail should be @bk.ru, but an error occurs at the point

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
galaxy, 2021-12-16
@dexering

Not quotes, but backticks are needed (however, you can do without them)

INSERT IGNORE INTO `users` (`username`, `password`, `email`) ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question