RE: [PHP] Variable just not Behaving Itself.

From: Date: Tue, 10 Aug 2004 23:50:40 +0000
Subject: RE: [PHP] Variable just not Behaving Itself.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-193415@lists.php.net to get a copy of this message
Hey, I was looking at your code and should that not be an If - ElseIf - Else structure? The way I read this is it first checks to see if the var is set to 'Permanent' and sets $UserStatus. Then regardless of the previous test it does another test on the $Emp_Status_Rqmt to see if it is 'Contactor' and if not it then sets the $UserStatus to 'Flexible'. So if someone is Permanent this would still end up setting the $UserStatus to 'Flexible'. This might be the root of your problem. Excuse me if I have misread the code. :-( HTH Kevin -----Original Message----- [SNIP] ... $Emp_Status_Rqmt=$row["Emp_Status_Rqmt"]; } if( $Emp_Status_Rqmt == 'Permanent' ) { $UserStatus = 'Permanent'; } if( $Emp_Status_Rqmt == 'Contractor' ) { $UserStatus = 'Contractor'; } else { $UserStatus == 'Flexible'; } [SNIP] which echoes OK until I change the value to something other than Permanent or Contractor. It simple echoes resource ID #n what's wrong with me...? the code I mean...?

« previous php.general (#193415) next »