forse intendevi questo
Codice PHP:
<?php 

if ($risultato=='y')
{

echo 
"<img src=\"img.jpg\">";

}
?>
occhio al titolo