PHP Code Request

Soldato
Joined
30 Jun 2003
Posts
2,807
Location
Berkshire
Would someone be able to help me on this

basically i need a bit of code that will when the database sends back "y" or "n" it will replace it with an image, so:

y = images/tick.gif
n = images/cross.gif

sorry if poorly explained but would be appreciated if this could be answered to
 
Code:
$value = [however you get the value from the database result]

if ($value == 'y') {
$output = 'images/tick.gif';
} elseif ($value == 'n') {
$output = 'images/cross.gif';
}
But why not just change the name of the images to y.gif/n.gif and embed the result directly ;) :)
 
Back
Top Bottom