Re: True or not true
| From: | Vojtech Dvorak | Date: | Tue, 18 Jul 2000 11:43:07 +0000 |
| Subject: | Re: True or not true | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1239@lists.php.net to get a copy of this message | ||
Oh my..!
Thx
----- Original Message -----
From: Salman AS <salmanas@telkom.net>
To: Vojtech Dvorak <vojtech_dvorak@servind.cz>
Cc: PHP-DB <php-db@lists.php.net>
Sent: Tuesday, July 18, 2000 1:40 PM
Subject: Re: [PHP-DB] True or not true
> Vojtech Dvorak wrote:
>
> > Hi,
> > I just made a little function for resolving true and false phase.
> > But even I change $trueorfalse to 0, It will show me "1, checked".
> > Why? I thing this is newbie fault, but I can't really hit the wall with
> > right solution.
> > Thanks for help
> >
> > <?PHP
> > function checked($value){
>
> try this:
> if ($value ==1){
> instead this:
>
> > if ($value = 1){
>
> since $value=1 is an assignment and $value==1 is comparison!
>
> >
> > echo $value;
> > echo "<br>checked"; }
> > else {
> > echo $value;
> > echo "<br>unchecked";}
> > }
> > $trueorfalse=1;
> > checked($trueorfalse);
> > ?>
>
> Cheers,
> -------------------
> Salman AS (SaS)
> salmanas@telkom.net
> -------------------
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>
>