事情是,我正试图插入一条从API Twitter
提取的推文,当我在使用MySQL
作为数据库语言的Amazon Web Services - RDS
部署的数据库表中做INSERT INTO
时,我有以下问题
ProgrammingError:(1064, "你的SQL语法有一个错误;查看与您的MySQL服务器版本对应的手册,以便在第3行"es la historia de Isis que decidió hacer un cambio en su vida professional hacie"附近使用正确的语法
我的代码示例是这样的:
INSERT_TWEETS = """INSERT INTO TWEETS (Author_id, Message_id, Message, Date_Time_Tweet, Replys, Retweets, Likes, Quotes)
values({}, {}, {}, {}, {}, {}, {}, {});"""
for index, row in tweets.iterrows():
db.changeSQL(db="Prueba_Tecnica", query=INSERT_TWEETS.format(row["Author_id"],
row["Message_id"], str(row["Message"]),row["Date_Time_Tweet"], row["Replys"], row["Retweets"], row["Likes"], row["Quotes"]))`
INSERT_TWEETS = """INSERT INTO TWEETS (Author_id, Message_id, Message, Date_Time_Tweet, Replys, Retweets, Likes, Quotes)
values({}, {}, {}, {}, {}, {}, {}, {});"""
for index, row in tweets.iterrows():
db.changeSQL(db="Prueba_Tecnica", query=INSERT_TWEETS.format(row["Author_id"],
row["Message_id"], str(row["Message"]),row["Date_Time_Tweet"], row["Replys"], row["Retweets"], row["Likes"], row["Quotes"]))`