ShriRam Changed status to publish August 21, 2023
import mysql.connector
mydb = mysql.connector.connect(
host=”localhost”,
user=”root”,
passwd=””,
database = “db_abc”
)
mycursor = mydb.cursor()
Name = input(“Enter Your Name “)
NewName = input(“Enter Your new Name “)
t=”Update tbl_Student1 SET SName='” + NewName + “‘ where SName='”+Name+”‘”
mycursor.execute(t);
mydb.commit()
print(“Records created successfully”)
mydb.close()
ShriRam Changed status to publish August 21, 2023