ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 13th, 2005, 01:46 PM
cootjealweer1 cootjealweer1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 28 cootjealweer1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 38 m 59 sec
Reputation Power: 0
Using the <cfelse> method

Hi all,

I've got a piece of code that i can't get to work, maybe one of u can check it out?

<cfquery name="tekst" datasource="spirilog">
<cfif #URL.tekst# EQ "tekst">
SELECT tekst
FROM onderwerpen
WHERE Id = #URL.Id#
<cfelse>
SELECT tekstvertaald
FROM onderwerpen
WHERE Id = #URL.Id#
</cfif>
</cfquery>

Can anyone help ?

Reply With Quote
  #2  
Old September 13th, 2005, 01:47 PM
cootjealweer1 cootjealweer1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 28 cootjealweer1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 38 m 59 sec
Reputation Power: 0
the <cfelse> method isn,t working so that's the question, how can i make it work?

Reply With Quote
  #3  
Old September 13th, 2005, 02:06 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,689 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 16 h 33 m 51 sec
Reputation Power: 53
Boolean logic can be strange if you aren't familiar with it. First, this:

<cfif #URL.tekst# EQ "tekst">
...
<cfelse>
...
</cfif>

Can just be this (you don't need the extra pound signs):
<cfif URL.tekst EQ "tekst">
...
<cfelse>
...
</cfif>

OK, so the only time the code within the <cfelse> block will execute is if the condition specified in the <cfif> block is false. So in this case, it will only ever run when URL.tekst does NOT equal "tekst". You can do a test to force this to happen by running:


<cfset url.tekst = "No way does this say 'tekst'!!!" />
<cfquery name="tekst" datasource="spirilog">
<cfif URL.tekst EQ "tekst">
SELECT tekst
FROM onderwerpen
WHERE Id = #URL.Id#
<cfelse>
SELECT tekstvertaald
FROM onderwerpen
WHERE Id = #URL.Id#
</cfif>
</cfquery>

The <cfelse> condition must fire in the above case.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #4  
Old September 16th, 2005, 06:53 AM
cootjealweer1 cootjealweer1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2005
Posts: 28 cootjealweer1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 38 m 59 sec
Reputation Power: 0
Red face

Hi, sorry for my late answer thanks for your help in this, works perfect

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Using the <cfelse> method


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT