()
| 53 | |
| 54 | |
| 55 | def Update(): |
| 56 | code = int(input("Enter the product id to update:")) |
| 57 | pid = int(input("Enter product id:")) |
| 58 | pname = input("Enter product name:") |
| 59 | pcost = int(input("Enter the product cost:")) |
| 60 | pqty = int(input("Enter the product quantity:")) |
| 61 | query = ( |
| 62 | "update inventory set PID={},PNAME='{}',PCOST={},PQTY={} where PID={}".format( |
| 63 | pid, pname, pcost, pqty, code |
| 64 | ) |
| 65 | ) |
| 66 | cursor.execute(query) |
| 67 | con.commit() |
| 68 | print("Data Updated SuccessfullY") |
| 69 | |
| 70 | |
| 71 | # Deleting records |