RE: [PHP] Easy Question -- Show/ Hide text based on output of query

2002-02-05 Thread Edward R. Bailey

Thanks for all your help, but I figured out what I did wrong

I was calling the memberNotes field using

 echo $get_detail->Fields("memberNotes") 

so when I replaced $memberNotes in the script with
$get_detail->Fields("memberNotes") it worked like a charm

 If ($get_detail->Fields("memberNotes")) {
 $notes = "Notes:";
} else {
 $notes = "";
}

Dumb error on my part. 

Thank you very much for your patience,

Ed


> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, February 05, 2002 1:53 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Easy Question -- Show/ Hide text based on 
> output of query
> 
> 
> On Wednesday 06 February 2002 02:53, Edward R. Bailey wrote:
> > Sorry -- Here it is
> >
> >
> >   >  $notes = " > size=-1>Notes:";
> >} else {
> >  $notes = "";
> >}
> >  ?>
> >
> > Then I call $notes using --
> >
> > echo ($notes)
> 
> I meant your *whole* script -- never mind, have you tried 
> echo($memberNotes) 
> to see what that contains? Are you sure it doesn't contain 
> spaces or other 
> non-visible characters?
> 
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> 
> /*
> "All language designers are arrogant.  Goes with the 
> territory..." (By Larry Wall) */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Easy Question -- Show/ Hide text based on output of query

2002-02-05 Thread Jason Wong

On Wednesday 06 February 2002 02:53, Edward R. Bailey wrote:
> Sorry -- Here it is
>
>
>$notes = " size=-1>Notes:";
>} else {
>  $notes = "";
>}
>  ?>
>
> Then I call $notes using --
>
> echo ($notes)

I meant your *whole* script -- never mind, have you tried echo($memberNotes) 
to see what that contains? Are you sure it doesn't contain spaces or other 
non-visible characters?


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
"All language designers are arrogant.  Goes with the territory..."
(By Larry Wall)
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Easy Question -- Show/ Hide text based on output of query

2002-02-05 Thread Edward R. Bailey

Sorry -- Here it is


 Notes:";
   } else {
 $notes = "";
   }
 ?>

Then I call $notes using --

echo ($notes)

> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, February 05, 2002 1:39 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Easy Question -- Show/ Hide text based on 
> output of query
> 
> 
> On Wednesday 06 February 2002 02:38, Edward R. Bailey wrote:
> > I used echo($notes) at the bottom of the page and the 
> output of $notes 
> > prints reardless of whether or not the db field 
> $memberNotes contains 
> > any data. It seems to me that $notes is always acting as if 
> > $memberNotes always contains data. Is their some way to 
> invoke $notes 
> > only if $memberNotes returns any data?
> 
> 
> Please post your full code.
> 
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> 
> /*
> "I go on working for the same reason a hen goes on laying eggs."
> - H. L. Mencken
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Easy Question -- Show/ Hide text based on output of query

2002-02-05 Thread Jason Wong

On Wednesday 06 February 2002 02:38, Edward R. Bailey wrote:
> I used echo($notes) at the bottom of the page and the output of $notes
> prints reardless of whether or not the db field $memberNotes contains
> any data. It seems to me that $notes is always acting as if $memberNotes
> always contains data. Is their some way to invoke $notes only if
> $memberNotes returns any data?


Please post your full code.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
"I go on working for the same reason a hen goes on laying eggs."
- H. L. Mencken
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Easy Question -- Show/ Hide text based on output of query

2002-02-05 Thread Edward R. Bailey

I used echo($notes) at the bottom of the page and the output of $notes
prints reardless of whether or not the db field $memberNotes contains
any data. It seems to me that $notes is always acting as if $memberNotes
always contains data. Is their some way to invoke $notes only if
$memberNotes returns any data?

Thanks for your help,
ED



> -Original Message-
> From: Jason Wong [mailto:[EMAIL PROTECTED]] 
> Sent: Tuesday, February 05, 2002 1:22 PM
> To: PHP General Mailing List
> Subject: Re: [PHP] Easy Question -- Show/ Hide text based on 
> output of query
> 
> 
> On Wednesday 06 February 2002 02:14, Edward R. Bailey wrote:
> 
> Please keep the discussion on the list!
> 
> > Thanks for responding! Yes the "memberNotes" database field only 
> > contains information in about a third of the records so I wanted to 
> > hide the entire field and label when their was no relevent data.
> >
> > I made the change you suggested, but the field label does 
> not show up 
> > when "memberNotes" contains data. As follows is the current 
> script. Is 
> > what what you suggested?
> >
> >
> >  > $notes = " > size=\"/-1\"/>Notes:";
> >   } else {
> > $notes = " > size=\"/-1\"/>";
> >   }
> > ?>
> 
> What are those forward slashes (/) doing in $notes? Try 
> getting rid of them, 
> they don't look very HTML to me :)
> 
> Also try echo($notes) OUTSIDE of a  construct to see 
> what it contains.
> 
> 
> hth
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> 
> /*
> Q:What do Winnie the Pooh and John the Baptist have in common?
> A:The same middle name.
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Easy Question -- Show/ Hide text based on output of query

2002-02-05 Thread Jason Wong

On Wednesday 06 February 2002 02:14, Edward R. Bailey wrote:

Please keep the discussion on the list!

> Thanks for responding! Yes the "memberNotes" database field only
> contains information in about a third of the records so I wanted to hide
> the entire field and label when their was no relevent data.
>
> I made the change you suggested, but the field label does not show up
> when "memberNotes" contains data. As follows is the current script. Is
> what what you suggested?
>
>
>  $notes = " size=\"/-1\"/>Notes:";
>   } else {
> $notes = " size=\"/-1\"/>";
>   }
> ?>

What are those forward slashes (/) doing in $notes? Try getting rid of them, 
they don't look very HTML to me :)

Also try echo($notes) OUTSIDE of a  construct to see what it contains.


hth
-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
Q:  What do Winnie the Pooh and John the Baptist have in common?
A:  The same middle name.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Easy Question -- Show/ Hide text based on output of query

2002-02-05 Thread Jason Wong

On Wednesday 06 February 2002 00:03, Edward R. Bailey wrote:
> 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.
>
>  Gremlins Associates -> www.gremlins.com.hk

/*
Where is John Carson now that we need him?
-- RLG
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php