Hello,
INTRO:
I have data in the database with some East East European Characters. They have been translated to their htmlentities before going in the database. What I see there are the numbers after &#
PROBLEM:
I need to export that data in .xls (EXCEL) file. Now the problem is that the data is exported as it is in the database. Means the characters are comming in &# form rather than their 'origional' form.
CODE:
Here is my code. Please let me know that what I should do with it?
require ('application.php');
header("Content-Type: application/vnd.ms-excel; charset=iso-8859-1");
header("Content-disposition: attachment; filename=" . date("Y-m-d")."-DataCollection.xls; ");
$sql = "SELECT * FROM DataCollection";
$result = @mysql_query($sql,$mysql_link );
if (!$result) {
echo( "<P>Unable to execute query at this time.</P>" );
exit();
}
echo "\"Name\"\t";
while ($row = mysql_fetch_array($result)) {
$name = $row['name'];
}
echo html_entity_decode($name);
}
}
NOTE: The data entry page is using iso-8859-1. So I guess that I shall use iso-8859-1 for export as well.