-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreception.py
34 lines (29 loc) · 856 Bytes
/
reception.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
28
29
30
31
32
33
34
import mysql.connector as mc
import New_cust
mydb = mc.connect(
host="localhost",
user="root",
password="1234",
database="restaurant"
)
conn = mydb.cursor()
def checker():
mydb = mc.connect(
host="localhost",
user="root",
password="1234",
database="restaurant"
)
conn = mydb.cursor()
conn.execute(f"select * from reception")
x = conn.fetchall()
if x == []:
pass
else:
conn.execute(f"select MIN(token) from reception")
token = (conn.fetchone())[0]
conn.execute(f"select Phone_no from reception where token={token}")
phone_no = (conn.fetchone())[0]
New_cust.new_customer(token_no=token, phone_no=phone_no)
conn.execute(f"delete from reception where token={token}")
mydb.commit()