Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
else problem
#3
Hello sorry for my English because I am french. I have a problem
when I run the program and I enter the right code that is "10"
it doesn't change the state of presence, but on the contrary, it shows me directly: "the code is not in the database"
I don't understand too much because it has to change my state from 0 to 1 in my database but my program runs as if I didn't enter the right code.

If you could help me with that I would be eternally grateful.

look my programm:

if (x) in (resultat):
    operation= ("SELECT * FROM enfants3; UPDATE enfants3 SET presence=""1"" WHERE RFID= 10")
    for result in cursor.execute(operation, multi=True):
        result.with_rows
        print("Rows produced by statement '{}':".format(
        result.statement))
        print(result.fetchall())
        print("Number of rows affected by statement '{}': {}".format(
        result.statement, result.rowcount))
else:
    print("the code is not in my database")
Reply


Messages In This Thread
else problem - by MJB - May-02-2020, 01:41 PM
RE: else problem - by pyzyx3qwerty - May-02-2020, 01:47 PM
RE: else problem - by MJB - May-02-2020, 01:56 PM
RE: else problem - by Yoriz - May-02-2020, 02:30 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020