Q Design a Python application to obtain a search criteria from user and then fetch records based on that from empl table. (given in chapter 12)
Answer = 
import mysql.connector as a
mydb = a.connect(host="localhost",user="root",password="portal express", database = "portal_express")
name = input("Enter the employee name :- ")
cur = mydb.cursor()
run = "select * from Empl where name = '{}'   ".format(name,)
cur . execute(run)
data  = cur.fetchall()
for i in data :
    print(i)
mydb.close()
is that all asked in the question?
ReplyDeleteyeah seems so
DeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )