Displaying search results - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Homework (https://python-forum.io/forum-9.html) +--- Thread: Displaying search results (/thread-27661.html) |
RE: Displaying search results - card51shor - Jun-17-2020 (Jun-16-2020, 08:36 PM)card51shor Wrote:(Jun-16-2020, 08:01 PM)ndc85430 Wrote: That example shows you how to use a variable in a template and how to pass a value for that variable to I'm open to anyone trying to help me though. (Jun-16-2020, 04:26 PM)pyzyx3qwerty Wrote: Seriously @card51shor? You refuse to solve a problem when we give you such big clues. We link you to sites if necessary - you have to understand there always is a reason behind what someone posts. Let's just assume I've looked at numerous code examples and I still can't figure it out. Then what? Am I just too dumb for Python? Or can you guys help me beyond links? RE: Displaying search results - pyzyx3qwerty - Jun-17-2020 No one's too dumb for python - just take your time going through the links, and you'll be able to understand the problem. RE: Displaying search results - card51shor - Jun-17-2020 (Jun-17-2020, 02:01 AM)pyzyx3qwerty Wrote: No one's too dumb for python - just take your time going through the links, and you'll be able to understand the problem. well i've gone through the links already and I still don't get it. RE: Displaying search results - ndc85430 - Jun-17-2020 If you made code changes, then you need to start showing us what you have. Surely you can just try things again? How are we supposed to help you become unstuck if we can't see what you're trying? This might be too much for you right now if you're already struggling with this, but you could consider using version control (e.g. Git or Mercurial) to keep track of your changes. RE: Displaying search results - card51shor - Jun-17-2020 I made changes but I'm back to using this since I know it works to some extent. I need to figure out a way to make b print out onto the screen for the user to see. I see the methods u showed. It's looking thru an array and printing each one with an html tag around it. However I don't know how to apply that to my code. @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") RE: Displaying search results - ndc85430 - Jun-17-2020 That's not really helpful, because we're just back to where we were at the beginning. We need to see what you're trying regarding templates, otherwise how are we supposed to get anywhere? RE: Displaying search results - card51shor - Jun-17-2020 ok i guess i[ll just figure it out on my own. Thanks. RE: Displaying search results - ndc85430 - Jun-17-2020 If you want us to help you, why won't you just show us what you're trying?! I don't understand how to help unless I see the code. RE: Displaying search results - card51shor - Jun-17-2020 Because I deleted it - it didn't work. Do you want me to try again? I already was frustrated with it but I'll give it my best shot might take me a bit. RE: Displaying search results - ndc85430 - Jun-17-2020 Well, yes. How else do you imagine we're going to get anywhere? Again, it's impossible to help without seeing the concrete problem, because we just end up having to guess and make assumptions. Have you ever used version control before? |