#๐Ÿ”’ need help with code (python sql connectivity)

7 messages ยท Page 1 of 1 (latest)

exotic jewelBOT
#

@proud forum

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

proud forum
#

#must make a database in sql named db5 and with table
#columns - name,doa,dod,people,NoRoom
cur=con.cursor()

print("Good evening")
print("what do you want to check")
print("1. to book a reservation")
print("2. to change your reservation in room")
print("3. check your information")
print("4. to cancel a reservation")
print("5. to check all details of guests staying")
print("")
num = int(input("enter no. adjacent to the task you want to perform: "))

#creating reservation

if num==1:
def task1():

    while True:
        name=input("Enter your Name: ")
        doa=input("enter your arrival date: ")
        dod=input("enter your departure date: ")
        people= int(input("enter no.of people staying: "))
        no=int(input("enter number of rooms required: "))

sql()
query= "insert into hotellist values("+name+","+doa+","+dod+","+people+","+no+")"+";"
cur.execute(str(query))
con.commit()
#

whenever i choose 1, it either shows error or blank

#

can someone please help me with this?

exotic jewelBOT
#

@proud forum

Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.

#

๐Ÿ”’ need help with code (python sql connectivity)