I'm trying to add info into a record from two different files, I'm trying to achieve this by opening the first file and adding to a record, then opening the second and updating that record.
with open('C:/Users/ELITEBOOK/documents/github/chatbot/chatbot/bot/human_text.txt', 'r') as table2, open('C:/Users/ELITEBOOK/documents/github/chatbot/chatbot/bot/robo_text.txt','r') as table3:
for line in table2.readlines():
message_text = line
#for robo_line in table3.readlines():
message_intent = ''
message_entities = ''
test = 'hello'
#cursor.execute('START TRANSACTION')
cursor.execute("INSERT INTO conversation (text) VALUES ('%s')" % line)
cnx.commit()
#cursor.execute((line))
for robo_line in table3.readlines():
#message_reply = robo_line
cursor.execute("UPDATE conversation SET reply = '%s' WHERE text = %s " % (robo_line, line))
#cursor.execute(robo_line)
cnx.commit()
I am receiving a Unknown column 'start' in 'where clause'
error, "start" is just the string from the first line in my second text file. I'm using string formatters right now because otherwise I get a syntax error, this code is only being used to update the DB once, not in production.