conn = pymysql.connect(
host = config.DATABASE_CONFIG['host'],
user = config.DATABASE_CONFIG['user'],
password = config.DATABASE_CONFIG['password'],
db = config.DATABASE_CONFIG['db']
)
curs = conn.cursor(pymysql.cursors.DictCursor)
sql = """INSERT INTO TEST (id, order, recom_code, recom_score) VALUES (%s, %s, %s, %s)"""
for idx in range(len(df)):
curs.execute(sql, tuple(df.values[idx]))
conn.commit()
pymysql.err.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'order, recom_code, recom_score) VALUES ('xxx', 'xxx', 'xxx', 'xxx')' at line 1")