HighDots Forums  

Displaying Boolean data

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Displaying Boolean data in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
oilovlam
 
Posts: n/a

Default Displaying Boolean data - 12-05-2007 , 04:53 PM






Probably something silly I'm doing or not doing.

I'm using Yes/No data from an Access db and I was expecting it to display
true/false on the Dreamweaver generated web page BUT instead I get one or zero
(1/0). Any suggestions, much appreciated


Reply With Quote
  #2  
Old   
oilovlam
 
Posts: n/a

Default Re: Displaying Boolean data - 12-05-2007 , 05:46 PM






I found a very ugly way of getting the output I wanted. Basically two if
statements (coldfusion) that test the 'exerciseReqd' field (true/false) and
display Yes or No (or whatever I want).

<cfif rs_tourDetail.exerciseReqd><cfoutput>Yes</cfoutput></cfif>
<cfif NOT rs_tourDetail.exerciseReqd><cfoutput>No</cfoutput></cfif>

This still doesn't explain why the book I'm following (Jeff Bardzell's
Dreamweaver MX 2004 with ASP, coldfusion and PHP) shows the page displaying
true/false with the following code:

<cfoutput>#rs_tourDetail.exerciseReqd#</fcoutput>

As I said I get one or zero with the above code. But enough time wasted, time
to move on.


Reply With Quote
  #3  
Old   
Coach Bob
 
Posts: n/a

Default Re: Displaying Boolean data - 01-03-2008 , 10:59 AM



oilovlam,

Not knowing your full set-up I can't be sure, but this is most likely a
function of your database. Access treats true/false values differently than
most databases. It's OK for a teaching tool and desktop applications, but not
really intended for web applications.

Can you tell me what chapter in Jeffrey's book this comes from? I believe it
was updated in the latest version and I might be able to tell you how it was
handled. It could be that I changed the database so that it was no longer a
true/false field. Like I said, Access is not really up to serious web
application use.Others will differ with that, but I stand by it. I would
recommend using MySQL for the exercises instead. There are quick and easy MySQL
installers for (WAMP5 for Windows and MAMP for Mac) that will have you up and
running in no time.

Just a quick note to optimize your CF code a bit. You only need cfoutput if
you are outputting a variable. You can also combine your cfifs. See below.

<cfif rs_tourDetail.exerciseReqd>Yes<cfelseif NOT
rs_tourDetail.exerciseReqd>No</cfif>

Best of luck,

Bob
http://bobflynn.info/


Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.