我正在尝试向以下代码添加if语句,但它会不断抛出错误。我做错了什么?
<%
int countOnRows = 0;
int i;
countOnRows= Integer.parseInt(formFields.getValue("broughtBack"));
if (countOnRows = 0) {
<h2>No data available - check back later </h2>
}
for( i=1; i<=countOnRows; i++ )
{ %>
<div class="a_report">
<h2>Dealer Sales Report</h2>
<h3>Sales Results as of July 2014 - <%=formFields.getValue("dealerName"+i)%>, Dealer <span class="dlr_info"># <%=formFields.getValue("dealerNo"+i)%></span></h3>
<div class="body_copy"><span class="print">[ <a href="javascript:window.print()">print this report</a> ]</span>
:
: table with table data in report here
:
<% } %>
</div>