dennismonsewicz Posted December 4, 2009 Share Posted December 4, 2009 I have the following code that is supposed to display a particular value depending on the IF statement evaluating to being true: value="<?php (isset($savings)) ? $savings : $bigZero;?>" $savings is being set from the DB and $bigZero is set like this: $bigZero = "$000.00"; When I run my script nothing is displayed for the value. Quote Link to comment https://forums.phpfreaks.com/topic/184002-ternary-operator-help/ Share on other sites More sharing options...
mikesta707 Posted December 4, 2009 Share Posted December 4, 2009 you probably want an echo in there value="<?php echo (isset($savings)) ? $savings : $bigZero;?>" Quote Link to comment https://forums.phpfreaks.com/topic/184002-ternary-operator-help/#findComment-971394 Share on other sites More sharing options...
dennismonsewicz Posted December 4, 2009 Author Share Posted December 4, 2009 Sweet! I knew I was missing something... this is my first time really diving in ternary operators and really appreciate your help Quote Link to comment https://forums.phpfreaks.com/topic/184002-ternary-operator-help/#findComment-971396 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.