Help with If else if

From: Date: Tue, 13 Mar 2012 12:03:43 +0000
Subject: Help with If else if
Groups: php.db 
Request: Send a blank email to php-db+get-48215@lists.php.net to get a copy of this message
Hi, Please help me with this code. I have 2 different fields in mysql table. What I want is if the field is empty don't show the image. Please look at the code below. <?php if($search->plugin->ListViewValue()=="") { echo '<a href="'.$search->facebook->ListViewValue().'"><img src="images/facebook.gif" width="22" height="23"/></a></a>'; } if($search->facebook->ListViewValue()=="") { echo '<a href="'.$search->plugin->ListViewValue().'"><img src="images/twitter.gif" width="22" height="23"/></a></a>'; } else if($search->plugin->ListViewValue()=="" && $search->facebook->ListViewValue()=="") { echo ""; } else { echo '<a href="'.$search->plugin->ListViewValue().'"><img src="images/twitter.gif" width="22" height="23"/></a></a>'.'<a href="'.$search->facebook->ListViewValue().'"><img src="images/facebook.gif" width="22" height="23"/></a></a>'; } ?> -- *Best, * *Gu®u*

« previous php.db (#48215) next »