Jump to content

Don't display image if null


jonw118

Recommended Posts

Have a very simple question, and my attempts haven't worked... what do I need to add to this code to make it not display an image if there isn't one uploaded? Right now it shows a broken image.

 

<?
$sql="select image from inputinfo where id='$id'";
$rez=mysql_query($sql,$dblnk);
$row=mysql_fetch_array($rez);
echo "<img src='admin/{$row['image']}' />";
?>

 

Thanks for any help!

Link to comment
https://forums.phpfreaks.com/topic/139777-dont-display-image-if-null/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.