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()
Rollno = input(“Enter Your RollNo “)
Name = input(“Enter Your Name”)
Age = input(“Enter Your Age”)
t=”INSERT INTO tbl_Student1 (RollNo, SName, Age) \
VALUES (‘” + Rollno + “‘, ‘” + Name + “‘, ‘” + Age + “‘)”
mycursor.execute(t);
mydb.commit()
print(“Records created successfully”)
mydb.close()
ShriRam Changed status to publish August 21, 2023