bossman Posted December 4, 2009 Share Posted December 4, 2009 hello all... i have a php calendar that we made, and when you click an event on it, a popup window opens up with all the event information in it. But...some of the events have a contact, and some dont... what i want to do is write an if, else statement to display the contact if it exists, and if it doesnt, display nothing... if (what do i put here) { echo "<div style='contact'><strong>• Contact</strong></div><br/><p class='show_desc'> ".$contact."</p>\n"; }else{ echo "<br />" } the question is in the example if statement above... what do i put there? the name of the column in my table is 'contact' (pretty simple) i assume it would be something like if $row['contact'] > 0 , but i think im wrong... any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/183994-need-help-with-a-simple-if-statement/ Share on other sites More sharing options...
mikesta707 Posted December 4, 2009 Share Posted December 4, 2009 if (isset($contact) && !empty($contact)){ //display } something like that what you're looking for? Quote Link to comment https://forums.phpfreaks.com/topic/183994-need-help-with-a-simple-if-statement/#findComment-971345 Share on other sites More sharing options...
bossman Posted December 4, 2009 Author Share Posted December 4, 2009 yes that makes sense thank you!!! Quote Link to comment https://forums.phpfreaks.com/topic/183994-need-help-with-a-simple-if-statement/#findComment-971358 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.