-
Notifications
You must be signed in to change notification settings - Fork 0
/
dataentryalt.py
27 lines (27 loc) · 1015 Bytes
/
dataentryalt.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import mysql.connector
conn=mysql.connector.connect(host="localhost",user="root",password="toor",database="ssdata")
c=conn.cursor()
def dataentryalt():
print("Enter the name")
Name=input()
print("Enter the type of vehicle")
vehicle_type=input()
print("Enter the vehicle number")
vehicle_number=input()
print("Enter the cost")
service_cost=input()
print("Enter the date")
date=input()
print(f" Name : {Name} \n Vehicle type : {vehicle_type} \n Vehicle No: {vehicle_number} \n Cost: {service_cost} \n Date: {date}")
print("Is it correct?")
correct_check=input()
if correct_check=="yes" or correct_check=="y":
query="""INSERT INTO servstation VALUES (%s,%s,%s,%s,%s)"""
data=(Name,vehicle_type,vehicle_number,service_cost,date)
c.execute(query,data)
conn.commit()
conn.close()
elif correct_check=="no" or correct_check=="n":
print("Do it again")
else:
print("Wrong input")