# Where I am wrong-Loadin data from mysql into flash

**URL:** <https://forum.kirupa.com/t/where-i-am-wrong-loadin-data-from-mysql-into-flash/266817>\
**Category:** programming\
**Created:** [July 24, 2008, 4:34pm UTC](https://forum.kirupa.com/t/where-i-am-wrong-loadin-data-from-mysql-into-flash/266817 "2008-07-24T16:34:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![brli](https://avatars.discourse-cdn.com/v4/letter/b/77aa72/32.png) [@brli](https://forum.kirupa.com/u/brli)\
**Post date:** [July 24, 2008, 4:34pm UTC](https://forum.kirupa.com/t/where-i-am-wrong-loadin-data-from-mysql-into-flash/266817/1 "2008-07-24T16:34:42Z")

</div>

If anybody reads this please help.  
I have been trying for 3 days to bring data to my flash page and still nothing.  
I am trying to query mysql according to a tutorial found here:[http://www.kirupa.com/developer/actionscript/flash\_php\_mysql.htm](http://www.kirupa.com/developer/actionscript/flash_php_mysql.htm)

I will show you the php file and if you know please tell me what should I change to suit the structure of mysql database.

php code: \<?php  
[//read.php](https://read.php)  
//prints contents of content column where  
filename = $file  
if($file) {  
$link = mysql\_connect(dbhost, dbuser, dbpassword)  
or die("\<b\>error\</b\>: failed to connect to database");  
$query = “SELECT content FROM files WHERE filename=’$file’”;  
$result = mysql\_query($query)  
or die("\<b\>error\</b\>: failed to execute query \<i\>$query\</i\>");  
mysql\_close($link);  
$desiredContent = mysql\_fetch\_array($result, MYSQL\_ASSOC);  
mysql\_free\_result($result);  
print “content=$desiredContent[content]”;  
?\>

this is the structure of mysql database:  
database:poraki  
table: info  
fields: id  
ime  
imeil  
poraka

This is myFLA script:  
onClipEvent (load) {  
loadVariables(“[http://localhost/read.php?file=testfile](http://localhost/read.php?file=testfile)”, this, “GET”);  
}

I have no idea what file= testfile reflects, nothink was said in the tutorial about this so  
if somebody knows I would be glad to hear:hugegrin:.  
I tried changing a lot of thinks in my php script and all I get was empty page.  
I am starting to doubt the functionality of the script but it is also higly possible that I am wrong somewhere.

Thanks for any help

Ace
