Advertisement
Guest User

Untitled

a guest
Dec 31st, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import mysql.connector
  2.  
  3. cnx = mysql.connector.connect(
  4. user='marcbot2',
  5. password='marcbot2',
  6. host='107.180.50.243',
  7. database='KLYS2')
  8.  
  9. cursor = cnx.cursor()
  10.  
  11. query = ("SELECT city FROM Realestate")
  12. cursor.execute(query)
  13.  
  14. data = cursor.fetchall()
  15.  
  16.  
  17. print(data[0],data[1])
  18.  
  19. cnx.commit()
  20. cnx.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement