N
N
Newbie2282022-01-24 04:01:27
Python
Newbie228, 2022-01-24 04:01:27

Is the sqlite3 cell in Python an anomaly or am I messing up?

Works:

spoiler
for value in sql.execute("SELECT nameboss FROM tboss WHERE death = '3:55'"):
    print(str(value[0]))
    print(timein)

Does not work:
spoiler
timein = "3:55"
for value in sql.execute(f"SELECT nameboss FROM tboss WHERE death = '{timein}'"):
    print(str(value[0]))
    print(timein)


what am I doing wrong?
as a result I want to get:
spoiler
timein = str(current_datetime.hour)+":"+str(current_datetime.minute)
for value in sql.execute(f"SELECT nameboss FROM tboss WHERE death = '{timein}'"):
    print(str(value[0]))
    print(timein)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
Wispik, 2022-01-24
@Newbie228

timein = "3:55"
for value in sql.execute("SELECT nameboss FROM tboss WHERE death = (?)", (timein, )):
    print(str(value[0]))
    print(timein)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question