i'm new to flask and dev in general this error is so subjective i can't google even after seeing couple of posts on stackoverflow i couldnt figure it out everything correct and literally i'm pulling my hair
@app.route("/bookPage/<all>" , methods=["GET" , "POST"])
def bookPage(all):
global all2
if request.method == "POST":
#variables
list1 = ['101','milk','3','jack','2018-09-27 16:33:58.553349' ]
db.execute("INSERT INTO review_table (id, review, rate , user , time_t) VALUES (:id, :review, :rate , :user , :time_t)" , {"id" : list1[0], "review" : list1[1], "rate": list1[2] ,"user":list1[3] , "time_t" :list1[4] })
db.commit()
print( f"review has been added of value : ,{review} \n ,and rate of : , { rate_i} ,\n , by user : , { user_i }, \n, and Id : , {id_i}" )
else:
print("\n\n",all,"\n\n")
all1 = all.split(",")
all2 =[a.strip("()").replace("'","") for a in all1]
return render_template("bookPage.html",all1=all2)
everytime i excute it i get this error ( ERROR: syntax error at or near "user" ) he points on the "user" in
"INSERT INTO review_table (id, review, rate , user , time_t)
everything correct i'm nw but i have done the db execute many times
table in db is empty postgresql of columns
Column Type Comment
id integer
review character varying NULL
rate integer NULL
user character varying NULL
time_t time without time zone NULL
please let me know why is this keep happening i've changed user input with constant string "test" i got the same error ... i think the error is misleading