janhavi
janhavi

Reputation: 31

Inserting user accepted inputs to database through flask

I am accepting user input in html file, and sending it back to flask, using method POST and accepting it in a,b,c,d variables. Now I am using the following query cur.execute("INSERT INTO Home VALUES(?,?,?,?)",a,b,c,d) to insert the values of a,b,c,d but I am getting an internal server error. How to solve this problem?

Upvotes: 0

Views: 358

Answers (1)

CL.
CL.

Reputation: 180020

If this is actually the code you're trying to execute:

cur.execute("INSERT INTO Home VALUES(?,?,?,?)",a,b,c,d)

then you must use a single list for the parameters list:

cur.execute("INSERT INTO Home VALUES(?,?,?,?)", [a,b,c,d])

Upvotes: 1

Related Questions