I'm trying to get my db.execute to work, managed to resolve the syntax error when using the LIKE operator along with a variable passed in from HTML, but it still doesn't give me results. (got closed by admin, so re-posting)
Used flask console to print and find out if any values passed at all, and it didn't. found variable not returning anything from dbExecute function
Why are my results not getting passed from db.execute?
My code extracted below:
@app.route("/search", methods=["POST"])
def search():
"""Search for books"""
# best example, but no data passed:
found = db.execute("SELECT * FROM books_table WHERE (isbn LIKE :lookingFor) OR (title LIKE :lookingFor) OR (title LIKE :lookingFor) OR (year::text LIKE :lookingFor)", {"lookingFor": f"%{searchBookVariableOnApplication_py}%"}).fetchall();
return render_template("search.html", found=found)