Advertisement
stevennathaniel

Python : Test Koneksi & Query Ke MySQL

Jul 10th, 2018
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  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])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement