Output Errors 2

From: Date: Tue, 22 Oct 2002 17:57:17 +0000
Subject: Output Errors 2
Groups: php.db 
Request: Send a blank email to php-db+get-22592@lists.php.net to get a copy of this message
Hi sorry back again. Thanks for helping me get the code right. Sorry being stupid again, I am having problems with an if / else statement. I am trying the following but it does not seem to work, what the problem is, that I am saying if the image name field in the database is empty to print nothing, and if it contains data to print that field name, as the a href is in the code which pulls the image, if the field is empty it should show nothing, but what happens is the image is shown in the browser and its not blank. Here is the revised code: echo ("<tr> \n"); echo ("<td width=\"72%\" valign=\"top\"><h3>$title</h3> \n"); echo ("<p>$description</p></td> \n"); echo ("<td width=\"28%\" valign=\"top\"> \n"); if (image == 'NULL') { echo '<p></p></td>'; } else { echo '<p><img src="' . $image . '" width="201" height="160"></p></td>'; } echo ("</tr> \n"); }} If someone can see the problem it would be most helpful. Best wishes Barry

« previous php.db (#22592) next »