Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import psycopg2
  2.  
  3. name = input()
  4. phone = input()
  5. bday = input()
  6. age = input()
  7.  
  8. con = psycopg2.connect(
  9. database = 'lexanidb',
  10. user = 'lexani42',
  11. password = 'lexani42',
  12. host = 'localhost'
  13. )
  14.  
  15. cur = con.cursor()
  16. cur.execute('INSERT INTO form (name, phone, bday, age) VALUES (%s, %s, %s, %s)', (name, phone, bday, age))
  17.  
  18. con.commit()
  19. con.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement