coldfusion - check the result of a CFQUERY via CFIF statement -
i having issue sytnax on how value database , check value in if statement in coldfusion
this have far:
<cfquery name="reservecheck" datasource="rc"> select comp_type partnercompany comp_id = "#cookie.risourceusrid#" </cfquery> <cfoutput> <cfif #reservecheck# neq 4> <li><a href="http://mywebsite/gonow/index.cfm" title="product search" target="_blank">product search</a></li> </cfif> </cfoutput>
change this:
<cfif #reservecheck# neq 4>
to this
<cfif reservecheck.comp_type neq 4>
this assumes query returns 1 row. if query returns more 1 row, code in answer looks @ first row. may or may not want.
Comments
Post a Comment