Easy Question -- Show/ Hide text based on output of query
| From: | Edward R. Bailey | Date: | Tue, 05 Feb 2002 16:03:33 +0000 |
| Subject: | Easy Question -- Show/ Hide text based on output of query | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-83599@lists.php.net to get a copy of this message | ||
Hi,
I am working on a page the displays the output of a query in a table and
I only want to show the field labels that have corresponding output from
the database. I am only really concerned with the last label in the
table.
The label is called "Notes" and the corresponding field in the database
is "memberNotes"
So I wrote the following script where I think I am saying if memberNotes
returns any value then print the output of $notes in the table cell
where it is called, but nothing happens and the output of $notes is not
displayed regardless whether "memberNotes" has any output.
<?php If ($memberNotes =='1') {
$notes = "<div align=\"/left\"/><font
size=\"/-1\"/><b>Notes:</b></font></div>";
} else {
$notes = "<div align=\"/left\"/><font
size=\"/-1\"/><b></b></font></div>";
}
?>
In the table cell I placed the following
<?php print $notes; ?>
Can anyone see what I am doing wrong??
Thanks for the help
Ed