D
D
dr0zd02020-04-24 19:43:02
Python
dr0zd0, 2020-04-24 19:43:02

Why doesn't the code see the table in sqlite?

I have this line:

q.execute("SELECT * FROM user_list WHERE user_id = %s" % (event.object.from_id))

The database table "user_list" exists, but the code gives the following error:
sqlite3.OperationalError: no such table: user_list
But the most interesting thing is that there is no problem if you run the code from pythonanywhere.

What could be the problem?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladislav the Wise, 2020-04-24
@yungtitanium

Maybe you will start using postgreSQL?

D
Dr. Bacon, 2020-04-24
@bacon

user_list is still missing in the database, or you are executing the request in the wrong database

A
Andrey_Dolg, 2020-04-26
@Andrey_Dolg

Chewed perfectly and in Russian, read:
https://ru.stackoverflow.com/questions/535318/%D0%...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question