Unknown Column in where clause when updating database

تعرفه تبلیغات در سایت

آرشیو مطالب

امکانات وب

Vote count: 0

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. Any help? 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.
asked 16 secs ago
Amon

نویسنده : استخدام کار بازدید : 0 تاريخ : جمعه 24 فروردين 1397 ساعت: 8:51
برچسب‌ها :

خبرنامه

عضویت

نام کاربري :
رمز عبور :