# PHP to FLash with an FOR() loop

**URL:** https://forum.kirupa.com/t/php-to-flash-with-an-for-loop/95499
**Category:** Uncategorized
**Created:** [November 26, 2003, 11:44am UTC](https://forum.kirupa.com/t/php-to-flash-with-an-for-loop/95499 "2003-11-26T11:44:01Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![excidium](https://avatars.discourse-cdn.com/v4/letter/e/e95f7d/32.png) [@excidium](https://forum.kirupa.com/u/excidium)
#### Post date: [November 26, 2003, 11:44am UTC](https://forum.kirupa.com/t/php-to-flash-with-an-for-loop/95499/1 "2003-11-26T11:44:01Z")

</div>

Hi,

I’m having an problem with php to flash, i think it’s really an newbie question but i just can’t find an solution for this problem.  
this works:

```php

while ($row = mysql_fetch_array($result)){
			
	$plaatje[] = $row["plaatje"];
		
		}
		print ("&plaatje0=$plaatje[0]&plaatje1=$plaatje[1]&plaatje2=$plaatje[2]&")

```

but in the future i’m getting like 300 variables out of mysql (&plaatje300=$plaatje[300]&), so i want to use an for loop:

```php

for($i=0; $i < 8; $i++) { 
	 $row = mysql_fetch_array($result);
	 $rString .= "&plaatje".$i."=".$row["plaatje"];

	 } 
	 $rString .= "&";
print $rString;

```

This works in the browser, only flash gets no variables. So i thought i had to solve it like this:

```php

for($i=0; $i < 8; $i++) { 
	 $row = mysql_fetch_array($result);
	 print( "&plaatje".$i."=".$row["plaatje"]);

	 } 

```

This doesn’t work either and i think it’s because there’s no ‘&’ mark to close the last variable ( like &plaatje2=$plaatje[2]&), but that’s just a guess…:puzzle:

Does anyone has an idear?  
thnx in advance!!
