SHARE
TWEET

Python : Test Koneksi & Query Ke MySQL

stevennathaniel Jul 10th, 2018 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import pymysql
  2.  
  3. db = pymysql.connect(host="localhost", user="root", passwd="", db="latihan")
  4.  
  5. kursor = db.cursor()
  6.  
  7. kursor.execute("SELECT * FROM cr1")
  8.  
  9. baris = kursor.fetchall()
  10.  
  11. print(baris[0])
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top