I just want to insert the table list into the mysql database table. Here's the code:
import mysql.connector
# Open database connection
a = [('apq3'), ('aquaporin')]
b = ["skin"]
c = ["down-regulated", "down regulation", "down regulate"]
def input_mysql(a1, b1, c1):
db = mysql.connector.connect(user='root', password='xxxx',
host='localhost',
database='crawling')
#sql = 'INSERT INTO crawling_result(search_content, content) VALUES(%s)'
sql_target_a = 'INSERT INTO a (term) VALUES(%s)'
sql_target_b = 'INSERT INTO b (term) VALUES(%s)'
sql_target_c = 'INSERT INTO c (term) VALUES(%s)'
cursor=db.cursor()
cursor.execute(sql_target_a, a1)
cursor.execute(sql_target_b, b1)
cursor.execute(sql_target_c, c1)
db.commit()
db.close()
a_content = a
b_content = b
c_content = c
input_mysql (a_content, b_content, c_content)
After running, it keeps showed that "mysql.connector.errors.ProgrammingError: Not all parameters were used in the SQL statement". Can some one help me?