Created
October 15, 2019 07:30
-
-
Save dharm6619/eb7115ca8e68057a061052c2b831b074 to your computer and use it in GitHub Desktop.
For Database Connectivity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymysql | |
connection = pymysql.connect("localhost","root","root","TEST") | |
print("Connected to Database") | |
cursor = connection.cursor() | |
sql = "insert into demo values(1,'Dharmendra',98)" | |
cursor.execute(sql) | |
print("Inserted") | |
connection.commit() | |
sql = "select * from TEST" | |
cursor.execute(sql) | |
cursor.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment