Re: problem: if / == / !=
| From: | none | Date: | Wed, 29 Nov 2000 10:52:51 +0000 |
| Subject: | Re: problem: if / == / != | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-27948@lists.php.net to get a copy of this message | ||
Sorry I usually post the site where I found the info
http://www.php.net/manual/language.types.type-juggling.php
Try echoing the variables to the screen, are they really the same? if
there are to many to display on the screen try adding
" LIMIT 0, 100"
to the end of your query. What turned up when you run the query from the
mysql command line? everything work there just like you were expecting?
Chris Lee
Mediawaveonline.com
In article <3A25C1BA.1C2EBB9B@asa.de>, reduct@asa.de wrote:
> 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
>