Вопрос

I'm trying to figure out how I can delete/get rid of this output if RECORDCOUNT=0. I don't want to show the output if RecordCount=0. Maybe there can be a better way to show this using a form? But this works.

I have been looking online for any help but I can't find something that can help me.

<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>
Это было полезно?

Решение

Put the record count check around the whole div / output depending on how much you need to show.

<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>
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top