close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Show if NOT NULL is not working for me.

Thread began 11/30/2022 7:37 pm by jo271221 | Last modified 12/15/2022 12:08 pm by Ray Borduin | 44 views | 11 replies |

jo271221

Show if NOT NULL is not working for me.

Can you please advise as how to write a show if rule for null.
I tried !-""
!=''
!=NULL
!+'(NULL)'

I checked and the value in my database field is (Null)

It appears my default options are NULL or empty string.
This is a decimal colum with 2 decimals. Which do you recomend NULL or empty string as default?

Thank you

Sign in to reply to this post

Ray BorduinWebAssist

empty() will catch both. If you post the full line of code then I could show you in context.

Sign in to reply to this post
Did this help? Tips are appreciated...

jo271221

Ok great. Pasted in PM - Thank you!

<?php
if (($WADAstats_barrel_races->getColumnVal("earnings_breeder")) > "0") { // WebAssist Show If
?>
<span class="breeder"> $<?php echo ($WADAstats_barrel_races->getColumnVal("earnings_breeder")); ?></span>
<?php
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

You can probably just use:

<?php
if ($WADAstats_barrel_races->getColumnVal("earnings_breeder")) { // WebAssist Show If
?>
<span class="breeder"> $<?php echo ($WADAstats_barrel_races->getColumnVal("earnings_breeder")); ?></span>
<?php
}
?>

Sign in to reply to this post
Did this help? Tips are appreciated...

jo271221

Thank you!
That worked for decimal columns. Is it not working for var char columns. I am pasting those in PM.

Sign in to reply to this post

jo271221

All the columns are NULL be default. Is there a better option for the default since that seems to be my problem.
What is the advantage or NULL verses EMPTY STRING?

I guess I am asking: when should NULL be used as default and when should EMPTY STRING be used?

Sign in to reply to this post

Ray BorduinWebAssist

They function similarly. I guess using empty string does keep things less complicated, but accounting for NULL isn't too difficult.

Sign in to reply to this post
Did this help? Tips are appreciated...

jo271221

OK, thanks. I guess we will work on those show if rules that varchar and are not working in a private session? (#5 posted 9:39am on this ticket)

Sign in to reply to this post

Ray BorduinWebAssist

if (($WADAstats_barrel_races->getColumnVal("sire")) != "") { // WebAssist Show If

becomes:

if (($WADAstats_barrel_races->getColumnVal("sire"))) { // WebAssist Show If

Sign in to reply to this post
Did this help? Tips are appreciated...

jo271221

Thank you but that did not work for me. I verified the record is showing a NULL value in the database.
I copied exactly what I tried.

Sign in to reply to this post
loading

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...