Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def details():
- rollnum = rnum.get()
- print(rollnum)
- conn = pymysql.connect(host='localhost', user='root', password='', db='data')
- a = conn.cursor()
- a.execute("select * from student where rollno='"+rollnum+"'")
- results = a.fetchall()
- count = a.rowcount
- print(results)
- print(count)
- if count > 0:
- for row in results:
- rnum1.set(row[0])
- sname.set(row[1])
- fanm.set(row[2])
- mtnm.set(row[3])
- dateob.set(row[4])
- bran.set(row[5])
- else:
- messagebox.showinfo("record not found")
- conn.close()
- def bookdetails():
- rollnum = rnum.get()
- print(rollnum)
- conn = pymysql.connect(host='localhost', user='root', password='', db='data')
- b = conn.cursor()
- b.execute("select * from issuebook where rollno='" + rollnum + "'")
- resultb = b.fetchall()
- countb = b.rowcount
- print(resultb)
- print(countb)
- if countb > 0:
- for row in resultb:
- booknm.set(row[1])
- booknum.set(row[2])
- dateofiss.set(row[3])
- lstdate.set(row[4])
- else:
- messagebox.showinfo("record not found")
- conn.close()
- def details_and_bookdetails():
- details()
- bookdetails()
Add Comment
Please, Sign In to add comment