Python Flask Search MySQL database turns up ()
<p>I have been working on a Python Flask app for some time now. I have got it to connect to a mysql database and do a search but all it throws up is ().</p>

<p>I am not sure if it is not finding anything or there is an error, but the Database has one item in it.</p>

<p>This is the main .py file</p>

<pre><code>from flask import Flask, render_template, request, url_for, redirect, flash
from connect_script import connection

app = Flask(__name__)

@app.route("/")
def homepage():
    flash("Hello")
    return render_template("main.html")


@app.route('/hello/', methods=['POST'])
def hello():
    error = ""
    rows = None
    user_input = None
    data = None
    try:
        c, conn = connection()
        if request.method == "POST":
            data = c.execute("SELECT * FROM titles WHERE name='%s' ", (request.form["search"],))
            user_input = (request.form["search"],)
            return render_template("main.html", data=data, user_input=user_input)

    except Exception as e:
        error = (str(e))
        return render_template("main.html", error=error, user_input=user_input)


if __name__ == "__main__":
    app.run(debug=True)
</code></pre>

<p>This file searches the Database and just pulls up results.html, and that looks like </p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html land="en"&gt;

&lt;head&gt;
    &lt;meta charset="utf-8"&gt;
    &lt;title&gt;Movie App&lt;/title&gt;
    &lt;link href="{{ url_for('static', filename='css/style.css') }}" /&gt;
    &lt;link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet"&gt;
    &lt;link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}"&gt;
&lt;/head&gt;
&lt;body&gt;
    {{ rows }}
&lt;/body&gt;
&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="{{ url_for('static', filename='js/bootstrap.min.js') }}"&gt;&lt;/script&gt;

&lt;/html&gt;
</code></pre>

<p>where {{ rows }} is all it renders is () nothing else. I have been searching around the net trying to find an answer but so far nothing.</p>

<p>The form that is is using looks like this</p>

<pre><code>  &lt;form class="navbar-form navbar-left" action="{{ url_for('hello') }}" method="POST" role="search"&gt;
    &lt;div class="form-group"&gt;
      &lt;input type="text" class="form-control" placeholder="Search" name="search" value="{{ request.form.search }}"&gt;
    &lt;/div&gt;
    &lt;button type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
  &lt;/form&gt;
</code></pre>

<p>Thanks for any help with this!</p>