Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import mysql.connector
- from mysql.connector import errorcode
- cnx = mysql.connector.connect(user='root', password='pwd', host='localhost', database='mhinhouse')
- cursor = cnx.cursor()
- add_email = ("INSERT INTO employee(MID, Email) VALUES (%s,%s)")
- email_details = (NULL, "a@a.de")
- cursor.execute(add_email, email_details)
- cnx.commit()
- input("data entered successfully")
- cnx.close()
Add Comment
Please, Sign In to add comment