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 Quote 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 Quote Link to comment https://forums.phpfreaks.com/topic/216392-need-help/#findComment-1124498 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.