Advertisement
Guest User

Untitled

a guest
Apr 1st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. import mysql.connector
  2.  
  3. cnx = mysql.connector.connect(user='root', password='',
  4.                               host='localhost',
  5.                               database='pythonn')
  6.  
  7. cursor = cnx.cursor()
  8.  
  9. name = input('Wpisz imie: ')
  10. surname = input('Wpisz nazwisko: ')
  11. cost = input('Wpisz dlug: ')
  12.  
  13. cursor.execute("INSERT INTO dluznicy VALUES (" + null + "," + name + "," + surname + "," + cost + ")")
  14.  
  15. cnx.commit()
  16.  
  17. cursor.close()
  18. cnx.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement