# Colorchange with PHP loading data into Flash

**URL:** <https://forum.kirupa.com/t/colorchange-with-php-loading-data-into-flash/176051>\
**Category:** Uncategorized\
**Created:** [January 19, 2006, 10:22pm UTC](https://forum.kirupa.com/t/colorchange-with-php-loading-data-into-flash/176051 "2006-01-19T22:22:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerryj](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jerryj](https://forum.kirupa.com/u/jerryj)\
**Post date:** [January 19, 2006, 10:22pm UTC](https://forum.kirupa.com/t/colorchange-with-php-loading-data-into-flash/176051/1 "2006-01-19T22:22:14Z")

</div>

Hi,

I have two mc’s (mc1 and mc2) on the stage and two textfields (color1 and color2). From a database through PHP I load two strings, for example ‘FF0000’ and ‘FFCCCC’. The funny thing is that with the codes I use, the textfields both show the right text. But mc1 makes the right colorchange, where mc2 turns to black.

AS:

```auto
color_read_lv = new LoadVars();
color_read_lv.onLoad = function(success) {
 if (success) {
  color1.text = color_read_lv.mc1;
  color2.text = color_read_lv.mc2;
  var headerColor = new Color(mc1);
  var h = "0x"+color_read_lv.mc1;
  headerColor.setRGB(h);
  var otherColor = new Color(mc2);
  var h = "0x"+color_read_lv.mc2;
  otherColor.setRGB(h);
 } else {
  color2.text = "error loading text";
 }
};
color_read_lv.load("color_read.php");

```

PHP:

```php
 
$query1 = "SELECT color FROM nieuws WHERE id = '1'";
$result1 = @mysql_query($query1);
if (!$result1) {
exit;
}
$table1 = mysql_fetch_array($result1);
$color1=$table1['color'];
print"&mc2=$color1";
$query2 = "SELECT color FROM nieuws WHERE id = '2'";
$result2 = @mysql_query($query2);
if (!$result2) {
exit;
}
$table2 = mysql_fetch_array($result2);
$color2 =$table2['color'];
print"&mc1=$color2";
mysql_close($connection);

```

And although the dat seem to come in (they show in the textfields), I have a feeling that the problem has to do with my PHP script. Because only query1 seems to do the job all the way (textfield and mc change).

Thanks,

Jerryj.
