# Flash php MySQL \[Troubles\]

**URL:** <https://forum.kirupa.com/t/flash-php-mysql-troubles/102330>\
**Category:** Uncategorized\
**Created:** [February 22, 2004, 3:17pm UTC](https://forum.kirupa.com/t/flash-php-mysql-troubles/102330 "2004-02-22T15:17:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnmartin](https://avatars.discourse-cdn.com/v4/letter/j/848f3c/32.png) [@johnmartin](https://forum.kirupa.com/u/johnmartin)\
**Post date:** [February 22, 2004, 3:17pm UTC](https://forum.kirupa.com/t/flash-php-mysql-troubles/102330/1 "2004-02-22T15:17:46Z")

</div>

Hi.  
I’m tryin to follow all steps of tutorial of this matter, but this is not working.  
I have uploaded a zip whit all files I’m working, so please check it and let me know what I’m doing wrong.

[Files](http://www.cristalab.com/pr0n/Flash_php_MySQL.zip)

Regards !

JOHNMARTIN

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 22, 2004, 11:36pm UTC](https://forum.kirupa.com/t/flash-php-mysql-troubles/102330/2 "2004-02-22T23:36:11Z")

</div>

your php code is wrong. this is how it should be:

```php

if($_GET['file']) {
  $file = $_GET['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]";
?>

```

(you have to use the $\_GET[] when referring to variables sent in the url string.)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [February 23, 2004, 3:37am UTC](https://forum.kirupa.com/t/flash-php-mysql-troubles/102330/3 "2004-02-23T03:37:09Z")

</div>

As you said I changed, but … this is not working.

Someone have the files complete and working to know where I’m mistake?

Regards !
