Page 50 - PYTHON-12
P. 50

mobileno=x[4]

                       check_in=x[5]
                       check_out=x[6]

                       adv_pay=x[7]
                       room_type=x[8]

                       print(cno,cname,address,roomno,mobileno,check_in,check_out,adv_pay,
               room_type)

               def edit():

               mydb=mysql.connector.connect(host="localhost",user="root",passwd="DBA",databa
               se="project")

                   mycur=mydb.cursor( )
                   mycur.execute("Select * from  hotel")

                   print("==========================================")
                   print("Before Updation")

                   myrec=mycur.fetchall()
                   for x in myrec:

                       cno=x[0]

                       cname=x[1]
                       address=x[2]

                       roomno=x[3]
                       mobileno=x[4]

                       check_in=x[5]
                       check_out=x[6]

                       adv_pay=x[7]
                       room_type=x[8]

                       print(cno,cname,address,roomno,mobileno,check_in,check_out,adv_pay,
               room_type)

                   cno=int(input("Enter The Customer Number you want to Update: "))
                   print("Enter the changes you want to make\n")

                   cname =input("Enter the Customer Name:  ")
                   address=input("Enter the Customer Address: ")

                   roomno=int(input("Enter the Room Number:  "))
                   mobileno=int(input("Enter the Mobile Number:  "))

                   check_in=input("Enter the Check-In Date (YYYY-MM-DD): ")

                   check_out=input("Enter the Check-Out Date (YYYY-MM-DD): ")
   45   46   47   48   49   50   51   52   53   54   55