Page 58 - PYTHON-12
P. 58
L.append(OrderF_id)
C_id=input("Enter the Customer ID : ")
L.append(C_id)
Emp_id=input("Enter the Employee ID: ")
L.append(Emp_id)
Food_id=int(input("Enter the Food ID:"))
L.append(Food_id)
Food_qty=input("Enter the Quantity:")
L.append(Food_qty)
Total_price=input("Enter the TotalPrice:")
L.append(Total_price)
OrderFood=(L)
sql="insert into OrderFood (OrderF_id,C_id,Emp_id,Food_id,Food_qty,Total_price
) values (%s,%s,%s,%s,%s,%s)"
mycursor.execute(sql,OrderFood)
mydb.commit()
def View():
print("Select the search criteria : ")
print("1. Employee")
print("2. Customer")
print("3. Food")
print("4. Ordered Food")
ch=int(input("Enter the choice 1 to 4 : "))
if ch==1:
s=int(input("Enter the Employee ID:"))
rl=(s,)
sql="select * from Employee where Emp_id=%s"
mycursor.execute(sql,rl)
res=mycursor.fetchall()
for x in res:
print(x)
elif ch==2:
s=input("Enter the Customer Name : ")
rl=(s,)