AwHeck Posted March 3, 2011 Share Posted March 3, 2011 I'm surely doing something wrong here, but I just cannot see it. Any assistance will be greatly appreciated. In a login script I read the following two variables from an SQL database. Both fields are defined as int. $this->ScheduleA = $rs->fetchCol('ScheduleA'); $this->SchedConst = $rs->fetchCol('SchedConstant'); Later, I retrieve these variables and attempt to compare them. $schA = $sess['ScheduleA']; $schC = $sess['SchedConst']; if ($schA == $schC) { require('Testing.php'); } else { require('NotAllowed.php'); } They never compare as equal, even though they contain the same value. What, pray tell, am I missing? Link to comment https://forums.phpfreaks.com/topic/229495-two-identical-db-fields-do-not-compare-equal/ Share on other sites More sharing options...
Pikachu2000 Posted March 3, 2011 Share Posted March 3, 2011 var_dump() both of them and see what the difference actually is. Link to comment https://forums.phpfreaks.com/topic/229495-two-identical-db-fields-do-not-compare-equal/#findComment-1182408 Share on other sites More sharing options...
Muddy_Funster Posted March 3, 2011 Share Posted March 3, 2011 there is more to the information that passes between your page and your database than meets the eye - litteraly. what steps have you taken to sanitise the input and output of these values? Link to comment https://forums.phpfreaks.com/topic/229495-two-identical-db-fields-do-not-compare-equal/#findComment-1182409 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.