@app.route("/home/search/details/<string:isbn_result_isbn>")
def book_search_results(isbn_result_isbn):
book_details = db.execute("SELECT * FROM books WHERE isbn=:g", {"g": isbn_result_isbn}).fetchone()
book_id = db.execute("SELECT * FROM book_reviews WHERE book_id=:v",{"v": book_details.id}).fetchall()
return (f"{book_id}")
Unfortunately book_id is returned as blank.
However if the query is hard coded:
(book_id = db.execute("SELECT * FROM book_reviews WHERE book_id=89).fetchall())
I get a result. I know the problem is with book_details.id (that being an integer but is cast as a string in the sql query & hence I get no result), but can't seem to figure a way out of this.
Kindly help
isbn=:g
,book_id=:v
byisbn=g
andbook_id=g
?