-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathparenttest.py
More file actions
23 lines (16 loc) · 927 Bytes
/
Copy pathparenttest.py
File metadata and controls
23 lines (16 loc) · 927 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import mysql.connector as sql
from tabulate import tabulate as tub
mycon=sql.connect(host='localhost',user='root',passwd='7654321',database='kvsfee')
uid=int(input("enter the unque id of student:"))
dob=input('enter the date of birth(yyyy/mm/dd):')
cursor=mycon.cursor()
cursor.execute("select unque_id from class_1 where dob = '{}'".format(dob))
data=cursor.fetchone()
cursor.execute("select unque_id,student_name,gender,sgsc,admission_no,dob,class,stream,fathers_name,mothers_name,fee_status from class_1 where unque_id = '{}';".format(uid))
data1=cursor.fetchall()
for i in data:
if uid ==i:
print("login sucessful")
print(tub(data1,headers=['UNQUE_ID','STUDENT NAME','GENDER','SGSC','ADMISSION NO','DOB','CLASS','STREAM','FATHERS NAME','MOTHERS NAME','FEE_STATUS'],tablefmt='psql'))
else:
print("invalid unque id please try again or contact to admin")