title: How to fix output in count query mysql (flask)
body: <p>How can I fix the output in my count query mysql (flask)</p>
  
  <pre><code>def addcart():
      cur = mysql.connection.cursor()
      if 'uid' not in session:
          noOfItems = 0
      else:
          uid = session['uid']
          cur.execute("SELECT count(id_phone) FROM cart WHERE id_users = " + str(uid))
          noOfItems = cur.fetchall()
      return (noOfItems)
  
  
  @app.route('/')
  def index():
      noOfItems = addcart()
      return render_template("index.html", noOfItems=noOfItems)
  </code></pre>
  
  <p>in my navbar</p>
  
  <pre><code>&lt;a href="#" class="btn btn-more i-left"&gt;
  &lt;small&gt;&lt;span class="badge badge-primary"&gt;{{noOfItems}}&lt;/span&gt;&lt;/small&gt;
  &lt;/a&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/coDlz.png" rel="nofollow noreferrer">OUTPUT</a> : <code>({'count(id_phone)': 3},)</code></p>