title: Using Flask to send form data to a database
body: <p>I've created a simple web page with a text field and a button. I want my application to update a record in my database with the content of the text field when I click the button. Seems simple enough, but I can't figure out what I'm missing. Here's my code thus far:</p>
  
  <p><strong>app.py sample</strong></p>
  
  <pre><code>@app.route('/update-audit/', methods=['POST'])
  def update_audit(test_name, description):
      cur = connect_db()
      cur.execute('UPDATE audit SET description = ? WHERE test_name = ?', (description, test_name,))
      return render_template('clicked.html')
  </code></pre>
  
  <p><strong>audit.html sample</strong></p>
  
  <pre><code>&lt;form action="{{ url_for('update_audit') }}" method="post"&gt;
      &lt;td&gt;{{ row[2] }}&lt;/td&gt;
      &lt;td&gt;
          &lt;input type="text" id="desc" value="{{ row[3] }}" size="140"&gt;
          &lt;input type="hidden" name="update_audit" value="{{ row[2] }}, desc"/&gt;
          &lt;input type="submit" class="btn btn-success" value="Update"/&gt;
      &lt;/td&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>clicked.html</strong></p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  {% extends "layout.html" %}
  {% block content %}
  &lt;body&gt;
  {{ form.description }}&lt;br /&gt;
  &lt;/body&gt;
  {% endblock %}
  </code></pre>
  
  <p><strong>table sample</strong></p>
  
  <pre><code>id | tool name | test name | description
  ========================================
  1  | "tool1"   | "test1"   | "update me!"
  </code></pre>
  
  <p>Not sure if I'm missing an essential concept (I played around with flask_wtf and didn't get anywhere) or if I'm a step or two away from making this happen.</p>