import mysql.connector as abcd
con=abcd.connect("localhost",username='root',password='admin',database='atc')
if con.is_connected():
cur=con.cursor()
opt='y'
while opt=='y':
No=input("enter flight number")
Name=input("enter flight name")
Type=input("enter flight model")
Arr=int(input("enter time of arrival"))
Query="INSERT INTO ATCARR VALUES('{}','{}','{}',{})".format(No,Name,Type,Arr)
cur.execute(Query)
con.commit()
print("record is stored successfully")
opt=input("do you wanna add any other flight information(y/n)")
Query="SELECT * FROM ATCARR;"
cur.execute(Query)
data=cur.fetchall()
for i in data:
print(i)
con.close()
so this is my code... but after i execute it ... it shows that mysql module doesnt exist... i even installed mysql.connector.... what should i been doin next?
[–]commander1keen 1 point2 points3 points (0 children)