My error is above. This is weird because it does exist. https://i.stack.imgur.com/q0Fyz.jpg That is my portfolio table. This is my command:

purchase = db.execute("INSERT INTO portfolio (shares, stock, price) VALUES          (shares, symbol, balance)")

Thanks, Ian

  • Hmmm, Are you connected to the correct database?
    – Cliff B
    Mar 28, 2017 at 21:21
  • Yes. I reran phpliteadmin and got the link and it is there.
    – Ianardo
    Mar 28, 2017 at 21:27

1 Answer 1


You need to use bound variables in the VALUES clause, else it takes them as string literals. Like

purchase = db.execute("INSERT INTO portfolio (shares, stock, price) VALUES (:shares, :symbol, :balance), shares=shares, symbol=symbol, balance=balance")

  • Just like that?
    – Ianardo
    Mar 28, 2017 at 22:51
  • edited answer. I can't guarantee it's perfect, it hasn't been run in the app. Mar 28, 2017 at 23:04
  • Hmmm.. It gives me this: RuntimeError: Bind parameter 'shares' without a renderable value not allowed here.
    – Ianardo
    Mar 28, 2017 at 23:07
  • so is there a variable "shares" in your program? Mar 28, 2017 at 23:25
  • there is. the thing is, it doesn't find anything
    – Ianardo
    Mar 29, 2017 at 1:22

You must log in to answer this question.

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