Here is my code to read from some data into MySql, the Mysql table contains 3 columns that in one of the columns I want to insert items of an array, each into a new row, and I do not want to have duplicate rows:
db = MySQLdb.connect("127.0.0.1", "root", "M0", "my", local_infile=True,use_unicode=True, charset="utf8")
cursor = db.cursor()
r=["2","3"]
params = ['?' for item in r]
sql="insert ignore into array (firt,last_name,arrays) values 'nina','sa',(%s);" % ','.join(params)
cursor.execute(sql,r)
db.commit();
db.close()
I have already looked into this post [1] as well !
However, on both of them I get this error:
_mysql_exceptions.ProgrammingError: not all arguments converted during string formatting
any suggestions, please?