Re: problem: if / == / !=

From: Date: Wed, 29 Nov 2000 10:15:33 +0000
Subject: Re: problem: if / == / !=
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-27930@lists.php.net to get a copy of this message
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>&nbsp;</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 >

« previous php.general (#27930) next »