Guest User

Untitled

a guest
Aug 11th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import mysql.connector
  2. from mysql.connector import errorcode
  3.  
  4.  
  5. cnx = mysql.connector.connect(user='root', password='pwd', host='localhost', database='mhinhouse')
  6.  
  7. cursor = cnx.cursor()
  8.  
  9. add_email = ("INSERT INTO employee(MID, Email) VALUES (%s,%s)")
  10. email_details = (NULL, "a@a.de")
  11.  
  12. cursor.execute(add_email, email_details)
  13.  
  14. cnx.commit()
  15. input("data entered successfully")
  16. cnx.close()
Add Comment
Please, Sign In to add comment