Nov-16-2018, 09:04 AM
Thanks for the reply.
The problem is that mysql.connector doesn't convert None or empty string to NULL so here is how i did it:
The problem is that mysql.connector doesn't convert None or empty string to NULL so here is how i did it:
data = None or "NULL" conn = cnx.cursor() conn.execute("insert into contract(red) values({}) ".format(str(data))) cnx.commit()this way even if red column is integer it will insert the data correctly. It would be great if there is an easier way to do it.