when I attempt to use my buy function, I get this error:

RuntimeError: (sqlite3.OperationalError) near ".": syntax error [SQL: "INSERT INTO buy (users.id, share, quantity, price) VALUES(3, 'AAPL', 1, 141.05)"]

If I change users.id to users_id on phpliteadmin and in the code, it seems to solve the problem. Why? Thanks


Here is the documentation for sqlite SELECT. The '.' represents the delimiter in a schema-name.table-name.column-name result-column expression.


Enclose the column name within square brackets . i.e [users.id]

Just a suggestion, avoid using '.' character in sql attribute names.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .