Re: problem: if / == / !=
| From: | magnus | Date: | Thu, 30 Nov 2000 02:55:54 +0000 |
| Subject: | Re: problem: if / == / != | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27940@lists.php.net to get a copy of this message | ||
No, that doesn't seem to work. I can't see (string) in the
documentation. Should I be placing an actual string of some kind there,
or am I right that it is itself a function?
Magnus
Chris Lee wrote:
>
> try forcing the typecast this will ensure that they are both being
> compared as strings.
>
> <?
> if ($write)
> if ((string)$sess_usr['name'] == (string)$row['name']))
> echo "<td><a
> href='et.php'</a></td>"; }
> else
> echo "<td> </td>";
> ?>
>
> Chris Lee
> Mediawaveonline.com
>
> In article <3A259C14.7497B857@asa.de>, reduct@asa.de wrote:
>
> > Hi, Can anyone say why this isn't working? I've tried it out with === as
> > well.
> > $row[name] is the field 'name' in a db table and the following is a test
> > used on every table row that is looped through.
> > $write is already set. I want to print a cell with 'edit' inside for
> > every instance where $sess_usr[name] - a session variable - is the same
> > as 'name' (itself originally set using $sess_usr[name])
> >
> >
> >
> > PS Don't mind the long url (I know it must be an imperfect solution).
> >
> > Thankyou,
> >
> > Magnus
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net