Re: if field is empty don't display the link (or field)
| From: | CPT John W. Holmes | Date: | Fri, 18 Apr 2003 11:50:52 +0000 |
| Subject: | Re: if field is empty don't display the link (or field) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144398@lists.php.net to get a copy of this message | ||
> Can you please help me with the following? What i'm trying to do is; when
a field of an query is empty don't display. But if the field has a value,
display a link.
>
> The result of the following code i've written is: When all fields or if
one of the tree fields is filled in , all three 'menu options' are
displayed.
>
> For the good order; what I want is this: when only the field 'eten' has a
value, only that link is displayed.
[snip]
> if (isset($row2->eten))
> {
> ?>
> <a href="steden.php?stedenid=<? echo $row2->stedenid;
?>&subj=eten">Eten</a></font>
> <?
> }
Use empty() instead of isset().
if(!empty($row->var))
{ //display link here }
Same thing for the rest of your links, if I'm understanding you correctly.
---John Holmes...