title: How to pass id from flask app to mysql database
body: <p>I have a flask application that is connected to the MySQL database.</p>
  <blockquote>
  <p>NOTE</p>
  <p>database name =  evaluation</p>
  <p>table name = evaluation</p>
  <p>columns = eval_id, eval_name, date</p>
  </blockquote>
  <p>I have an 'evaluation table' with field eval_id, eval_name and date in it.</p>
  <pre><code> mysql&gt; use evaluation;
      mysql&gt; describe evaluation;
      +-----------+-------------+------+-----+---------+-------+
      | Field     | Type        | Null | Key | Default | Extra |
      +-----------+-------------+------+-----+---------+-------+
      | eval_id   | int(11)     | NO   | PRI | NULL    |       |
      | eval_name | varchar(20) | NO   |     | NULL    |       |
      | date      | datetime(6) | NO   |     | NULL    |       |
      +-----------+-------------+------+-----+---------+-------+
  </code></pre>
  <p>How can I write an API to get a particular evaluation by its id?
  I tried the below,  but it doesn't work.</p>
  <pre><code>@app.route('/getEval/&lt;int:eval_id&gt;', methods=['GET'])
  def getEvalByID(eval_id):
      cur.execute('''select * from evaluation.evaluation where eval_id=eval_id''')
      res = cur.fetchall()
      return jsonify({'test':str(res)})
  </code></pre>
  <p>How can I correct this and get only the evaluation based on the eval_id mentioned in the app.route.</p>