def update(id, name, address, phone_number, Dose, Age, V_id): from back import calculation conn = sqlite3.connect("jamel.db") cur = conn.cursor() cur.execute( "UPDATE jamel SET name=? ,address=? , phone_number=? , Dose=? , Age=? , V_id=? where id=?", (name, address, phone_number, Dose, Age, calculation(Age, Dose), id)) conn.commit() conn.close()
def update(id, name, address, phone_number, room_type, no_of_days, total): from back import calculation conn = sqlite3.connect("hotel.db") cur = conn.cursor() cur.execute( "UPDATE hotel SET name=? ,address=? , phone_number=? , room_type=? , no_of_days=? , total=? where id=?", (name, address, phone_number, room_type, no_of_days, calculation(no_of_days, room_type), id)) conn.commit() conn.close()
def insert(name, address, phone_number, no_of_days, room_type, total): from back import calculation conn = sqlite3.connect("hotel.db") cur = conn.cursor() cur.execute("INSERT INTO hotel VALUES (NULL, ?,?,?,?,?,?)", (name, address, phone_number, no_of_days, room_type, calculation(no_of_days, room_type))) conn.commit() conn.close() view()