Pasa Mike Posted February 18, 2007 Share Posted February 18, 2007 I've tried writing this a few different ways: the goal is to return " - " + ['enddate'] only if the field ['enddate'] contains a value. the end result being ['startdate'] - ['enddate'] or simply ['startdate'] if there is no enddate... Thanks for the help... (the book i have for PHP is not very helpful) Link to comment https://forums.phpfreaks.com/topic/38991-solved-if-statement-returning-field-value-only-if-not-null/ Share on other sites More sharing options...
kenrbnsn Posted February 18, 2007 Share Posted February 18, 2007 Please show us the code you've tried. Ken Link to comment https://forums.phpfreaks.com/topic/38991-solved-if-statement-returning-field-value-only-if-not-null/#findComment-187691 Share on other sites More sharing options...
Pasa Mike Posted February 18, 2007 Author Share Posted February 18, 2007 <?php if ('enddate' != "NULL") { echo $row_comingevent['enddate']; } ?> I still need to add in the dash ("-") before the enddate, but i can't get the enddate function alone to work Link to comment https://forums.phpfreaks.com/topic/38991-solved-if-statement-returning-field-value-only-if-not-null/#findComment-187699 Share on other sites More sharing options...
JasonLewis Posted February 18, 2007 Share Posted February 18, 2007 try just NULL instead of "NULL" Link to comment https://forums.phpfreaks.com/topic/38991-solved-if-statement-returning-field-value-only-if-not-null/#findComment-187702 Share on other sites More sharing options...
Pasa Mike Posted February 18, 2007 Author Share Posted February 18, 2007 that did it, thanks! Link to comment https://forums.phpfreaks.com/topic/38991-solved-if-statement-returning-field-value-only-if-not-null/#findComment-187719 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.