Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
INSERT INTO transaction (company, shares, price, totalprice, id) VALUES ('Apple Inc.', 1, 217.58, 217.58, 4)"]-------this is the correct value i want to insert and i pull it from the error area. if i put in SQL directly, it shows " NSERT INTO transaction (company, shares, price, totalprice, id) VALUES ('Apple Inc.', 1, 217.58, 217.58, 4)"] ERROR: near "transaction": syntax error"
# update tables, transction detail db.execute("INSERT INTO transaction (company, shares, price, totalprice, id) VALUES (:company, :shares, :price, :totalprice, :id)", company = company, shares = shares, price = price, totalprice = totalprice,id = session["user_id"]) i think i did, because i changed the primary of this table called tradedid, and keep the userid still called id, similar as users table, which is not the primary unique key
so i changed the transaction data base and added what you mentioned and i left my code the same as before.However, it still does not work. anything more specific i can do pls? thanks. sorry for taking this long to revisit.