close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Echo Yes or No instead of 1 or 0

Thread began 10/09/2011 8:27 am by Jon Cunningham | Last modified 10/10/2011 3:26 pm by Jason Byrnes | 636 views | 3 replies |

Jon CunninghamBeta Tester

Echo Yes or No instead of 1 or 0

Hi Guys,

May I trouble someone to poke me in the right direction.

I have a column in my user table called "UserFeature"

In my insert form I have a check box called "Featured User" which writes a 0 to the database by defalt (unticked) and writes 1 to the database when checkbox is ticked. Works a treat.

On my user Details page, Featured User echo's either 1 or 0. How would get this to echo either Yes or No instead.

Secondly, The Check box has no tick in on the update page when the db shows as 1. Im Sure this is going to be a SQL statement, but again any help in the right direction would be appreciated.

Hope that this make sense.

Kind regards

Jonathon

Sign in to reply to this post

Jon CunninghamBeta Tester

I worked out the second part of my question reference showing a tick in the check box if 1 is written to the db. (1 = yes 0 = No)

Solution

1. Clicked on the checkbox and in the properties panel, click Dynamic.
2. Click on the "Check if" Lighting Bolt and choose the desired check box from the Recordset.
3. In the "Equal to" box enter 1 and click ok


Jonathon

Sign in to reply to this post

Jon CunninghamBeta Tester

Update:

Now have the fiirst part of my question figured out.

Solution

Replaced

<?php echo($row_WADAusers['UserFeatured']); ?>

With

<?php echo($row_WADAusers['UserFeatured'] == 1) ? "Yes" : "No" ; ?>

Now echo's either Yes or No instead of 1 or 0.

Jason if you could check my solution and post back that would be really appreciated.

Kind regards

Jonathon

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, Jonathon, your solution is correct.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...