P
P
paralolik2020-10-06 08:20:23
Python
paralolik, 2020-10-06 08:20:23

Where does "No such column" come from in SQLite3?

There is this block of code:

import sqlite3

sql.execute("""CREATE TABLE IF NOT EXISTS users (
    login TEXT,
    password TEXT,
    сash INT
)""")
db.commit()

db = sqlite3.connect('server.db')
sql = db.cursor()

def enter():
    for i in sql.execute("SELECT cash FROM users"):
        print(i)

enter()

And it throws an error:

Traceback (most recent call last):
  File "sql.py", line 10, in <module>
    enter()
  File "sql.py", line 7, in enter
    for i in sql.execute("SELECT cash FROM users"):
sqlite3.OperationalError: no such column: cash

At the same time, if you select "login" or "password" the command is executed without errors, what is wrong with this "cash"?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dr. Bacon, 2020-10-06
@paralolik

with ash vs c ash

D
Dimonchik, 2020-10-06
@dimonchik2013

from there
https://sqlitebrowser.org/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question