Hrvoje Posted October 20, 2010 Share Posted October 20, 2010 In making some simple script I stuck with code: I want to display pictures ex.. green.jpg or red.jpg - true or false Code: $img = ($row['available'] == 'yes') ? '<img src="images/green.jpg" width="120" height="20" />' : '<img src="images/red.jpg" width="120" height="20" />'; and down in table echo: <?PHP echo $img ?> What is wrong? Im beginer in php, please help. Thanks Link to comment https://forums.phpfreaks.com/topic/216392-need-help/ Share on other sites More sharing options...
Hrvoje Posted October 20, 2010 Author Share Posted October 20, 2010 Problem solved.... simple mistake $img = ($row['available'] == 'yes') ? 'green.jpg' : 'red.jpg'; <img src="images/<?PHP echo $img ?>" width="120" height="20" /> Thanks anyway Link to comment https://forums.phpfreaks.com/topic/216392-need-help/#findComment-1124498 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.