如果RECORDCOUNT = 0,我试图找出如何删除/删除此输出。我不想 如果RecordCount = 0,则显示输出。也许有更好的方法来使用表单来展示这个?但这很有效。
我一直在网上寻求任何帮助,但我找不到可以帮助我的东西。
<cfquery datasource ="Intranet" name="GetDeptSubmissions">SELECT * FROM CSEReduxResponses</cfquery>
<cfquery dbtype="query" name="GetPending">SELECT * FROM GetDeptSubmissions WHERE status = 1 AND execoffice_status = 0</cfquery>
<cfquery dbtype="query" name="GetApproved">SELECT * FROM GetDeptSubmissions WHERE status = 1 AND execoffice_status = 1</cfquery>
<cfquery dbtype="query" name="GetDenied">SELECT * FROM GetDeptSubmissions WHERE status = 1 AND execoffice_status = 2</cfquery>
<cfoutput>
<h2>Comments / Ratings Administration</h2>
<div>
<div class="display_count pending_outer">
<div class="display_count_desc pending_inner">Pending</div>
<cfif GetPending.RecordCount gt 0><a href="cse_execoffice_pending.cfm"></cfif>
<span class="display_count_number">#GetPending.RecordCount#</span>
<cfif GetPending.RecordCount gt 0></a></cfif>
</div><!--- /div class="display_count" --->
..........................
</div>
</cfoutput>
答案 0 :(得分:3)
根据您需要显示的数量,将记录计数检查放在整个div /输出周围。
<cfif GetPending.RecordCount gt 0>
<div class="display_count pending_outer">
<div class="display_count_desc pending_inner">Pending</div>
<span class="display_count_number">
<a href="cse_execoffice_pending.cfm">#GetPending.RecordCount#</a>
</span>
</div>
</cfif>