remybink Posted July 30, 2011 Share Posted July 30, 2011 $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 More sharing options...
trq Posted July 30, 2011 Share Posted July 30, 2011 $width = $row['width']; if ($width) { $width .= 'in.'; } Link to comment https://forums.phpfreaks.com/topic/243237-simplify-query-for-null/#findComment-1249256 Share on other sites More sharing options...
remybink Posted July 30, 2011 Author Share Posted July 30, 2011 oh. wow. I feel stupid. Link to comment https://forums.phpfreaks.com/topic/243237-simplify-query-for-null/#findComment-1249260 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.