I have a Function (within the class Database)
function locTo (){//return the location of the to currency
$con = dbconnect(); //instantiate db connection
$locationTo= mysql_query ("SELECT location FROM Sheet1 where currency_code = '$this->to'", $con);
$lol = mysql_fetch_array($locationTo);
return $lol['location'];
mysql_close();
}
when I call the function
$foo = new Database($from,$to);
$hey = $foo->LocTo();
echo $hey;
or
$foo = new Database($from,$to);
echo $foo->LocTo();
It out puts correctly.
Im trying to put into XML and im getting an encoding error.
This is my XML
echo '<?xml version="1.0" encoding="UTF-8"?>';
echo '<conv>';
echo'<at>'.$timefrom.'</at>';
echo'<rate>'.$rate.'</rate>';
echo'<from>';
echo'<code>'.$from.'</code>';
echo'<curr>'.$currencyFrom.'</curr>';
echo'<loc>'.$locFrom.'</loc>';
echo'<amnt>'.$amount.'</amnt>';
echo'</from>';
echo'<to>';
echo'<code>'.$to.'</code>';
echo'<curr>'.$currencyTo.'</curr>';
echo'<loc>'.$locTo.'</loc>';
echo'<amnt>'.$convertedAmount.'</amnt>';
echo'</to>';
echo'</conv>';
Does anyone know why I am getting an encoding error? I have checked the source code and it gets as far as the location.
here is an example of the location out put.
AED to GBP
United Arab Emirates
United Kingdom, Crown Dependencies (the Isle of Man and the Channel Islands), certain British Overseas Territories ( South Georgia and the South Sandwich Islands, British Antarctic Territory and British Indian Ocean Territory)