0% found this document useful (0 votes)
5 views1 page

c-3

The document contains SQL commands for inserting order and customer data into a database. It includes error handling for invalid product IDs and prompts the user to continue adding products to the cart. Finally, it closes the database connection after the operations are completed.

Uploaded by

manav.12111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

c-3

The document contains SQL commands for inserting order and customer data into a database. It includes error handling for invalid product IDs and prompts the user to continue adding products to the cart. Finally, it closes the database connection after the operations are completed.

Uploaded by

manav.12111
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

com6 = """

INSERT INTO order1 (cust_id, order_id, pr_id,


quantity, price, totalprice, DOO)
VALUES (%s, %s, %s, %s, %s, %s, CURRENT_DATE)
"""
cur.execute(com6, (j, i, z, w, price, total_price))

com6 = """
INSERT INTO customer (cust_id, cust_name,
order_id, totalprice, DOO)
VALUES (%s, %s, %s, %s,CURRENT_DATE)
"""
cur.execute(com6, (j, v, i, total_price))

conn.commit()
print("Your Customer ID: ",j)
print("Your Order ID: ",i)
print("Product added to cart successfully!")
print("THANK YOU FOR ORDERING")
except TypeError:
print("Invalid Product ID!")
finally:
inp=input("Do you want to or more(y/n): ")
if inp.lower()=="y":
add_to_cart()
cur.close()
conn.close()
print()

You might also like