Never mind .. I sorted it out ..

-----Original Message-----
From: Jenny Gavin-Wear [mailto:[EMAIL PROTECTED]
Sent: 25 June 2008 12:25
To: CF-Talk
Subject: Negatives


I have a cfif condition for a positive/negative value of 1 or -1, but when I
run the query to get the value it is always returning a positive, regardless
of the value in the MSSQL table.

I have set the field type to hold the value as numeric.

The idea is that the levels of navigation can be opened and closed and when
open show the next level below of nav links.

Any ideas of where I am going wrong, please?

Jenny

Page header:
<cfif isdefined("url.navID") and isdefined("url.navOpen")>
<cfquery datasource="#application.dsn#" name="navOpen">
select * from cms_nav where navID = #url.navID#
</cfquery>
<cfset navState = #navOpen.navOpen# * -1>
<cfquery datasource="#application.dsn#">
update cms_nav set navOpen = #navState#
where navID = #url.navID#
</cfquery>
</cfif>


Page body:
          <cfoutput query="navtop">
          <cfset session.mNavID = navTop.navID>
          <div id="nav1">
          <a
href="navigation.cfm?navID=#navtop.navID#&navopen=1">#navtop.NavTitle#</a>
          <cfif session.mNavOpen gt 0>
          <div id = "nav2">
          <cfquery datasource="#application.dsn#" name="nextNav">
          select * from cms_nav where navLinkID = #session.mNavID#
          </cfquery>
          <cfloop query="nextNav">
          <a
href="navigation.cfm?navID=#nextNav.navID#&navopen=1">#nextNav.NavTitle#</a>
          </cfloop>
          </div>
                  </cfif>
          </div>
          </cfoutput>





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:308110
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to