redarrow Posted May 25, 2006 Share Posted May 25, 2006 hi there all advance thank you.i am trying to get the image to appear if the ansaw is no a x.gif or if the ansaw is yes a diffrent image cheers.[code]<?$query4="SELECT * from member_info where name='$name' and id='$id'";$result4=mysql_query($query4);while($per4=mysql_fetch_assoc($result4)) {if($per4["club"]=="yes"){$per4["club"]="<img src='images/tick.gif'></img>"; }else if($per4["club"]=="no"){$per4["club"]="<img src='images/x.gif'></img>";echo $per4["club"];}}?>[/code] Link to comment https://forums.phpfreaks.com/topic/10423-turning-one-statement-to-another-with-else-and-if/ Share on other sites More sharing options...
AndyB Posted May 25, 2006 Share Posted May 25, 2006 [code]<?php$query4 = "SELECT * from member_info where name='$name' and id='$id'";$result4 = mysql_query($query4);$per4 = mysql_fetch_assoc($result4));if($per4["club"]=="yes"){ $img = "tick.gif";} else { $img = "x.gif";}echo "<img src='images/". $img. "'/>";?>[/code] Link to comment https://forums.phpfreaks.com/topic/10423-turning-one-statement-to-another-with-else-and-if/#findComment-38845 Share on other sites More sharing options...
redarrow Posted May 25, 2006 Author Share Posted May 25, 2006 [!--quoteo(post=376955:date=May 25 2006, 10:11 AM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ May 25 2006, 10:11 AM) [snapback]376955[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]<?php$query4 = "SELECT * from member_info where name='$name' and id='$id'";$result4 = mysql_query($query4);$per4 = mysql_fetch_assoc($result4));if($per4["club"]=="yes"){ $img = "tick.gif";} else { $img = "x.gif";}echo "<img src='images/". $img. "'/>";?>[/code][/quote]fase error were cheers.[!--quoteo(post=376960:date=May 25 2006, 10:23 AM:name=redarrow)--][div class=\'quotetop\']QUOTE(redarrow @ May 25 2006, 10:23 AM) [snapback]376960[/snapback][/div][div class=\'quotemain\'][!--quotec--]fase error were cheers.[/quote][!--sizeo:5--][span style=\"font-size:18pt;line-height:100%\"][!--/sizeo--]solved[!--sizec--][/span][!--/sizec--] cheers Link to comment https://forums.phpfreaks.com/topic/10423-turning-one-statement-to-another-with-else-and-if/#findComment-38850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.