Jun-18-2020, 06:35 AM
(This post was last modified: Jun-18-2020, 06:35 AM by card51shor.)
Wait if you read anything I just said - disregard it. I don't need to have that isbn url link like I suggested.
All I need to do is have it so when you click on any of the search results, you get a book page with info on the book.
I think I can handle that. I'm going to take a break and try again tomorrow night. Please leave any tips in the meantime! Here is my current code:
PYTHON:
Thanks
All I need to do is have it so when you click on any of the search results, you get a book page with info on the book.
I think I can handle that. I'm going to take a break and try again tomorrow night. Please leave any tips in the meantime! Here is my current code:
PYTHON:
@app.route("/search", methods=["GET", "POST"]) def search(): search = request.form.get("search") searchCombo = search + '%' result = db.execute("SELECT * FROM books WHERE author LIKE :search OR isbn LIKE :search OR title LIKE :search LIMIT 20", {'search': searchCombo}).fetchall() return render_template("search.html", search=result) @app.route("/book", methods=["GET", "POST"]) def book(): return render_template("book.html")I'm currently working on book.html and creating the file. One quick question I think I'll have is : How do I pass the value from search.html (with all the search result info I need) into books.html? I assume I pass it through the template just like I did with search? Do I use the same variable name? Does it matter?
Thanks