Jump to content

[SOLVED] php help with eliminating code


ded

Recommended Posts

With the code below, if the database does not have a picture in it, the dreaded "Box With An X in it" shows up.  Is there a way to eliminate the middle "echo" code if nothing appears in the field "picture"?

 

 

 

while($row = mysql_fetch_array($resultr))
{
    echo "<h2>" . $row['fname'] . " " . $row['lname'] . "</h2>";
    echo "<img src=" . $row['picture'] . " class=newsimages>"; 	
    echo $row['comments'];
}
?>

 

 

Thanks,

DED

Link to comment
https://forums.phpfreaks.com/topic/106717-solved-php-help-with-eliminating-code/
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.