我是 python flask.i 的新手。我有一个名为 header.html 的 html 文件。我创建的所有 html 文件都在 /templates 文件夹中,如烧瓶文档中所述。我在 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.