# Php vars won't pass to movieclip

**URL:** <https://forum.kirupa.com/t/php-vars-wont-pass-to-movieclip/116546>\
**Category:** Uncategorized\
**Created:** [July 19, 2004, 1:18pm UTC](https://forum.kirupa.com/t/php-vars-wont-pass-to-movieclip/116546 "2004-07-19T13:18:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ndamofli](https://avatars.discourse-cdn.com/v4/letter/n/a87d85/32.png) [@ndamofli](https://forum.kirupa.com/u/ndamofli)\
**Post date:** [July 19, 2004, 1:18pm UTC](https://forum.kirupa.com/t/php-vars-wont-pass-to-movieclip/116546/1 "2004-07-19T13:18:55Z")

</div>

hi again  
something is going wrong. Although i am able to duplicate the movieclip (\_root.dp) i cannot pass the vars into the moviclip.

myLoadbleData = new LoadVars();  
myLoadbleData.load(“[http://www.damofli.com/news/fetch\_categories\_and\_news.php?id=1](http://www.damofli.com/news/fetch_categories_and_news.php?id=1)”);  
percentLoaded = myLoadbleData.getBytesLoaded()/myLoadbleData.getBytesTotal();  
myLoadbleData.onLoad = function(success) {  
myArray = new Array();  
if (success) {  
trace(“variables loaded”);  
for (var i = 1; i\<this.new\_count; i++) {  
\_root.dp.duplicateMovieClip(“nn”+i, i+200);  
_root[“nn”+i].y = (i-1)\*150;  
eval(“nn”+i).ana = eval("new\_name" add i);  
eval(“nn”+i).aid = eval("new\_id_" add i);  
new\_image.\_visible = 1;  
new\_scrollbar.\_visible = 1;  
new\_instructions\_object.text = new\_instructions;  
}  
gotoAndPlay(1);  
} else {  
gotoAndPlay(224);  
// The data didn?t load at all. Display error  
}  
};  
stop();

php code

```php

```

require (“database.inc”);  
$DB = new Database;

if ($search) {  
$query = "SELECT id, name FROM news " .  
“WHERE MATCH (name, author, instructions) AGAINST (” .  
$DB-\>quote($search) . “)”;  
} else {

$query = "SELECT news.id, news.name " .  
"FROM news, new\_category\_xref AS xref " .  
“WHERE news.id=xref.new\_id " .  
“AND xref.category\_id=” . $DB-\>quote($id) .  
" ORDER BY news.name”;  
}  
$result = $DB-\>query($query);

$i = 0;  
while (list($news\_id, $news\_name) = mysql\_fetch\_row($result)) {  
echo “new\_id\_” . $i . “=” . $news\_id . “&”;  
echo “new\_name\_” . $i . “=” . urlencode($news\_name) . “&”;  
$i++;  
}  
echo “new\_count=” . $i . “&”;  
mysql\_free\_result ($result);

if ($search) {  
echo “cat\_count=0&”;  
$id = 0;  
} else {  
$query = “SELECT id, name FROM categories " .  
“WHERE parent\_id=” . $DB-\>quote($id) .  
" ORDER BY name”;  
$result = $DB-\>query($query);  
$i = 0;  
while (list($cat\_id, $cat\_name) =  
mysql\_fetch\_row($result)) {  
echo “cat\_id\_” . $i . “=” . $cat\_id . “&”;  
echo “cat\_name\_” . $i . “=” . urlencode($cat\_name) .  
“&”;  
$i++;  
}  
echo “cat\_count=” . $i . “&”;  
}

if ($id==0) {  
echo “parent\_id=0&category\_name=” .  
urlencode($cookbook\_name);  
} else {  
$query = “SELECT parent\_id, name FROM categories WHERE id=” . $DB-\>quote($id);  
$result = $DB-\>query($query);  
$i = 0;  
list($cat\_id, $cat\_name) = mysql\_fetch\_row($result);  
echo “parent\_id=” . $cat\_id . “&”;  
echo “category\_name=” . urlencode($cookbook\_name .  
": " . $cat\_name);  
}  
?\>

```php

```

please help
