Please could someone help with this ( I am trying to do some geo targeting on my web site). When I echo the result from a db query it prints exactly as I would expect, in this case 'UNITED KINGDOM', but when I try and compare the string with a matching string to produce a true or false result it always returns false. (I've encountered this before and never understood why)
//--taking results from a mysql table
$country_name=$ccode_array['country_name'];
//--echo the results - this works OK
echo $country_name; //prints UNITED KINGDOM
//--Here's the problem, this returns "False" when it should return "True"
if($country_name =="UNITED KINGDOM"){
echo "True";
}else{
echo "False";
}
The data type for the country_name field is set to varchar(50)
The record in question contains only "UNITED KINGDOM" and no other characters.
Thanks
Rob