Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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)
- <a href="#" class="btn btn-more i-left">
- <small><span class="badge badge-primary">{{noOfItems}}</span></small>
- </a>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement