daily pastebin goal
16%
SHARE
TWEET

Untitled

a guest Sep 4th, 2018 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pymysql.cursors
  2.  
  3. connection = pymysql.connect(host="127.0.0.1", database="addressbook", user="root", password="")
  4.  
  5. try:
  6.     cursor = connection.cursor()
  7.     cursor.execute("select * from group_list")
  8.     for row in cursor.fetchall():
  9.         print(row)
  10. finally:
  11.     connection.close()
  12.  
  13. try:
  14.     cursor = connection.cursor()
  15.     cursor.execute("select * from addressbook")
  16.     for rows in cursor.fetchall():
  17.         print(rows)
  18. finally:
  19.     connection.close()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top