# Problems decoding from SQL=\>PHP=\>Flash

**URL:** <https://forum.kirupa.com/t/problems-decoding-from-sql-php-flash/192186>\
**Category:** Uncategorized\
**Created:** [June 26, 2006, 8:54pm UTC](https://forum.kirupa.com/t/problems-decoding-from-sql-php-flash/192186 "2006-06-26T20:54:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![CommanderCool](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/commandercool/32/158_2.png) [@CommanderCool](https://forum.kirupa.com/u/CommanderCool)\
**Post date:** [June 26, 2006, 8:54pm UTC](https://forum.kirupa.com/t/problems-decoding-from-sql-php-flash/192186/1 "2006-06-26T20:54:12Z")

</div>

i’m having a bit of trouble passing strings from a MySql Database to flash through php. The main problem i believe is when the data being retrieved includes a percent (%) sign. It seems at this point when the data is displayed, instead of showing .ie 4.24% it shows ‘4.24f’ or even crazier, instead of ‘2.36%’ (as stored in the database) it shows ‘2.36=2/1&totalunits1=72&perc’… which tells me the url string is being broken up. this is causing havoc in the app i’m trying to develop and im wondering if anyone can help me figure out how to solidly translate all character types when passing from sql to flash. i’m using ecode/decode methods, and i know the % sign is a delimiter for url-encoded strings, but i figured it should encode the % sign as well… here’s a chunk of the code im using:

PHP (loaded to flash as LoadVars Object):  
\<?php  
utf8\_decode & utf8\_encode;  
header(“content type: text/richtext; charset=UTF-8”);

… query results to $financial\_data[] array …

$rString = “”;

foreach($financial\_data as $key =\> $value) {  
if(!is\_int($key) && $key!=‘ID’ && $key!=‘propertyID’) {  
$value = urlencode($value);  
$rString .="&$key=$value";  
}  
}

echo $rString;  
?\>

FLASH:

loaddata = new LoadVars();  
loaddata.load(toLoad);  
loaddata.onLoad = function() {  
myArray = new Array();  
for(var a in this){  
if(a != “onLoad”) {  
myVal = unescape(this[a]);  
myArray.push(myVal);  
}  
}

… functions sorting myArray[] …

}

will this simply not work for % signs?.. are there any ways around this? I hope to god the next version of flash would have MySQL functions built in… this method seems a little cumbersome, and if anyone has figured out how to solve these issues and can help i’ll be eternally grateful, thanks.

\_CC
