DELETING VALUES FROM TABLES.py

import mysql.connector as mq
md=mq.connect(host="localhost",user="root",passwd="hacker",charset="utf8",database="sidd")
if md.is_connected():
    print("connection established")
mcur=md.cursor()
st="delete from shukla where rollno={}".format(1)
mcur.execute(st)
md.commit()
mcur.execute("select * from shukla")
data=mcur.fetchall()
for i in data:
    print(i)

md.close()

Comments

Popular Posts