i am new in python flask.i have html file named as header.html .all the html files i have created, are in the /templates folder as discussed in flask documentation. i am having following code in header.html
<li>
<a href="items" class="dropdown-toggle no-arrow">
<span class="fa fa-calendar-o"></span><span class="mtext">here i want to display</span>
</a>
</li>
my question is , i want to write python flask select query just above my <li> tag and i want to display number of selected items in <span> tag.
i have already applied this below solution
<%
mycursor.execute("SELECT * FROM category")
length=len(mycursor.fetchall())
%>
however its not working.i am using mysql database.any help will be appreciated.