Jun-16-2020, 05:37 AM
Hey guys so now I'm on the next stage of my project that I've been slaving over thanks to you guys!
I now have it where it searches the database and displays the results to the terminal.
What's the best way to display the results to the website with a link for each one where the user can click and get more information on that item?
I would think I can create HTML elements with Python but I looked into it and it looks like it would be way more complicated then perhaps is necessary.
Here is my code so far. Any ideas on what I should do to best display the search info? Thanks!
I now have it where it searches the database and displays the results to the terminal.
What's the best way to display the results to the website with a link for each one where the user can click and get more information on that item?
I would think I can create HTML elements with Python but I looked into it and it looks like it would be way more complicated then perhaps is necessary.
Here is my code so far. Any ideas on what I should do to best display the search info? Thanks!
@app.route("/search", methods=["GET", "POST"]) def search(): search = request.form.get("search") search1 = search + '%' b = db.execute("SELECT * FROM books WHERE author LIKE :search OR isbn LIKE :search OR title LIKE :search LIMIT 10", {'search': search1}).fetchall() print(b) return render_template("search.html")