【发布时间】:2021-08-11 05:38:23
【问题描述】:
我在 phpmyadmin 中有以下代码:
CREATE TABLE IF NOT EXISTS Leaderboard2 (Player text, Score float)
当我在 python 中运行相同的代码时(我希望能够更改排行榜):
make_leaderboard = ("CREATE TABLE IF NOT EXISTS Leaderboard%s (Player text, Score float)")
cursor.execute(make_leaderboard, *Leaderboard_Number*)
它出现了这个错误:
mysql.connector.errors.ProgrammingError: 1064 (42000): 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 '%s (Player text, Score float)' at line 1
关于如何解决这个问题的任何想法?
【问题讨论】:
标签: python mysql phpmyadmin mysql-python mysql-connector