# Php/Flash loadVars()

**URL:** https://forum.kirupa.com/t/php-flash-loadvars/118305
**Category:** Uncategorized
**Created:** [August 4, 2004, 12:45pm UTC](https://forum.kirupa.com/t/php-flash-loadvars/118305 "2004-08-04T12:45:55Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![straycat](https://avatars.discourse-cdn.com/v4/letter/s/ecae2f/32.png) [@straycat](https://forum.kirupa.com/u/straycat)
#### Post date: [August 4, 2004, 12:45pm UTC](https://forum.kirupa.com/t/php-flash-loadvars/118305/1 "2004-08-04T12:45:55Z")

</div>

Hi there, I am trying to load this php into flash.

```php

<?php
echo "fred";
if(! $connect = mysql_connect("localhost", "root", "") ) die("Connection to DB failed");
mysql_select_db("clipboard", $connect);
$result = mysql_query("SELECT * FROM clip where 1");
echo count($result);
while($row=mysql_fetch_array($result)){
 echo "id$cant=$row[id]&movie$cant=$row[movie]&description$cant=$row[description]&type$cant=$row[type]&";
 $cant++;
}
echo "cant=$cant";
?>
  

```

and am using this .AS. as the flash loading part

```auto
 
myData = new LoadVars() 
		myData.ref = this 
		myData.load("clips.php") 
		myData.onLoad = function(){ 
			if(succes){ 
				for(var i=0; i<this.cant; i++){ 
					this.ref["id"+i].text = this["id"+i] 
					this.ref["movie"+i].text = this["movie"+i] 
					this.ref["description"+i].text = this["description"+i] 
	 this.ref["type"+i].text = this["type"+i]
				} 
			} else trace("Error loading data") 
		} 
  
stop() 

```

Keep getting an error (on the trace)… not sure what I am doing wrong  
Anyone help much appreciated?..

SC/ 🙂
