Jump to content

simplify query for NULL ?


remybink

Recommended Posts

$width = ($row['width']);
                    if  ($width == NULL){
                      $width = "Call";
                      }else {
                        $width = $width .' '.'in.';
                        }

 

What would be a simpler way to write this? Or should I say better? I am not ready for the "switch" method, would prefer the longer form. This script works. However, i want to get no output if the result is empty or NULL.

The reason I chose a string was that I had issues and placing a string seemed to fix it.

Link to comment
https://forums.phpfreaks.com/topic/243237-simplify-query-for-null/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.