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()
cursor = mycursor.execute(“SELECT RollNo, SName, Age from tbl_student1”)
for row in mycursor:
print (“Rollno = “, row[0])
print (“Name = “, row[1])
print(“Age = “, row[2], “\n”)
print(mycursor.rowcount, “record inserted.”)
ShriRam Changed status to publish August 21, 2023