Hi
I've got a bit of code that extracts data from a db and then writes it to a txt file so that it can be loaded into a Flash file.
The original txt file is saved in UTF-8 to keep the accents on the characters but when it's overwritten by the php function for some reason it seems to stop being UTF-8 and the accented characters are replaced by rectangles as if it was written in ANSI format
also, the line returns don't work and are replaced with rectangles too.
here's the code
mysql_connect($host,$user,$pass);
mysql_select_db("hugo_site")or die("sorry, couldn't connect");
$req = mysql_query("SELECT * FROM portfolio_data");
$fp = fopen("D:\Mes documents\Sites\hugo scott\portfolioData.txt", "w") or die ("no go");
while ($result = mysql_fetch_array($req))
{
$rank = $result['rank'];
fwrite($fp, "&buttonTitle_".$rank."=".$result['buttonTitle']."&"."\n");
fwrite($fp, "&extPicClip_".$rank."=".$result['extPicClip']."&"."\n");
fwrite($fp, "&urlPath_".$rank."=".$result['urlPath']."&"."\n");
fwrite($fp, "&text1_".$rank."=".$result['text1']."&"."\n");
fwrite($fp, "&text2_".$rank."=".$result['text2']."&"."\n");
fwrite($fp, "&text3_".$rank."=".$result['text3']."&"."\n");
fwrite($fp, "&newY_".$rank."=".$result['newY']."&"."\n");
}
fwrite($fp, "&numButtons=".$rank."&"."\n");
fwrite($fp, "&loadCheck=ok&"."\n");
fclose($fp);
mysql_close();
has anyone got any ideas?
thanks