Ell20 Posted October 29, 2007 Share Posted October 29, 2007 Hey guys, Im trying to display some information in a while loop however one of the bits of data is optional so I dont want the heading to be displayed if there is no data in the variable. Here is my code at the moment but it dosent appear to be working: <?php if(isset($row['description'])) { echo "<b>Team Description: </b>"; echo $row['description']; echo "<br>"; } ?> Thanks for any help Quote Link to comment Share on other sites More sharing options...
Orio Posted October 29, 2007 Share Posted October 29, 2007 Well obviously it's set, but probably just empty... use !empty() instead of isset() Orio. Quote Link to comment Share on other sites More sharing options...
Dragen Posted October 29, 2007 Share Posted October 29, 2007 <?php if(!empty($row['description'])) { echo "<b>Team Description: </b>"; echo $row['description']; echo "<br>"; } ?> Quote Link to comment Share on other sites More sharing options...
Ell20 Posted October 29, 2007 Author Share Posted October 29, 2007 Thanks for your help, spot on as usual! Elliot Quote Link to comment 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.