Re: Output Errors 2
| From: | Maureen | Date: | Tue, 22 Oct 2002 18:05:04 +0000 |
| Subject: | Re: Output Errors 2 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-22594@lists.php.net to get a copy of this message | ||
Unless it is a typo, the line that reads:
if (image == 'NULL') { echo '<p></p></td>'; }
should read:
if ($image == 'NULL') { echo '<p></p></td>'; }
^
You forgot the $ in front of image.
HTH
MB
Bzdpltd@aol.com said:
> 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
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--