ole90
09-04-2007, 06:20 PM
So i get a value from my database which is either a number or a string.
$database_value = $row['database_value'];
and then i want to compare this value to see whether or not it equals the string "ALL"
so
$all = "ALL";
if(strcmp($database_value, $ALL) == 0) {
echo"Values are equal";
} else {
echo"Values are not equal";
}
But this doesn't seem to be working for me. It always says that database_value does not equal ALL, even though i've checked and double checked that it does contain ALL.
any help?
$database_value = $row['database_value'];
and then i want to compare this value to see whether or not it equals the string "ALL"
so
$all = "ALL";
if(strcmp($database_value, $ALL) == 0) {
echo"Values are equal";
} else {
echo"Values are not equal";
}
But this doesn't seem to be working for me. It always says that database_value does not equal ALL, even though i've checked and double checked that it does contain ALL.
any help?