title: Search query in python
body: <p>I'm attempting to complete an assignment where I need to create a search bar that when a user inputs an isbn, author, or title, it returns results based off of a data table with book information. It should account for partial matches. Using python, postgresql (Heroku), flask, jinja.</p>
  
  <p>I'm brand new to python so I've tried everything I've researched so far. I think the error is in my html file but can't quite figure out where the issue is or how to fix it. When I put something in the search bar, I'm taking to results.html but all that prints is the  line.</p>
  
  <p>Python</p>
  
  <pre><code>@app.route("/search", methods=['GET', 'POST'])
  def search():
  
   if request.method == 'POST':
  
      search=request.form.get("search")
  
      results=db.execute("SELECT * FROM books WHERE isbn LIKE ('%' || 
      :search || '%') or  author LIKE ('%' || :search || '%') or title 
      LIKE ('%' || :search || '%')",{"search":search})
  
  
      return render_template("results.html", search=results)
      else:
      return redirect("search.html")
  </code></pre>
  
  <p>results.html (where I think the problem is):</p>
  
  <pre><code>    {% extends "layout.html" %}
      {% block body %}
  
      &lt;h3&gt; RESULTS &lt;/h3&gt;
  
  
      &lt;ul&gt;
      {% for results in books %}
       &lt;li&gt; &lt;a href = "{{url_for('search', title = search.title)}}"&gt; 
            {{search.title}}, {{search.author}}&lt;/a&gt; &lt;/li&gt;
    {% endfor %}
      &lt;/ul&gt;
  
  
     {% endblock %}
  </code></pre>
  
  <p>This should return a list of results based on the query and what matches in the database. For reference, my table has the following columns (isbn, title, author, year).</p>