# Showing/hiding data from MySQL database using PHP

**URL:** <https://forum.kirupa.com/t/showing-hiding-data-from-mysql-database-using-php/235563>\
**Category:** flash\
**Created:** [August 12, 2007, 11:02pm UTC](https://forum.kirupa.com/t/showing-hiding-data-from-mysql-database-using-php/235563 "2007-08-12T23:02:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![iamali](https://avatars.discourse-cdn.com/v4/letter/i/9d8465/32.png) [@iamali](https://forum.kirupa.com/u/iamali)\
**Post date:** [August 12, 2007, 11:02pm UTC](https://forum.kirupa.com/t/showing-hiding-data-from-mysql-database-using-php/235563/1 "2007-08-12T23:02:17Z")

</div>

Hi all,  
I’m working on this 3D Flash photo gallery thingy - [http://www.alisongreen.me.uk/majorproject/w4/](http://www.alisongreen.me.uk/majorproject/w4/) . I’ve got the images to load in to Flash from a MySQL database using PHP using the “filename” field in the database. I’ve also got the description to load into dynamic textfields within movie clips using the “description” field in the database. What I’d like though is for the user to be able to click on the moving images and the description movieclip to appear for each one, but I can’t seem to figure out a way to associate the description with the image. Anyone have an idea? Here’s my code:  
Code to load images and description from database:

```auto
_root.mc_wall_past._visible = true;
_root.txt_past._visible = true;
_root.btn_back_past._visible = true;
_root.mc_holderpast._visible = false;
_root.mc_textholder._visible = false;
pastImagesOpen = new LoadVars()
pastImagesOpen.load("db_past.php");
pastImagesOpen.ref = this;
pastImagesOpen.onLoad = function(imgLoad){
 if(imgLoad){
  for(var i=0; i<this.count; i++){
   fn = this['filename'+i];
   duplicateMovieClip("mc_textholder", "mc_textholder"+i, i+200)
   this.ref["mc_textholder"+i].desc.text = this['description'+i];
   duplicateMovieClip("mc_holderpast", "mc_holderpast"+i, i)
   loadMovie("http://www.alisongreen.me.uk/majorproject/w4/past/thumbnails/" + fn, "mc_holderpast"+i);
   this.attachMovie("mc_textholder2", "mc_textholder9", i+200);
  }
 } else trace("Error loading data")
}
stop();

```

Code on the mc\_holderpast movieclip that is duplicated for each image:

```auto
onClipEvent(load) {
 function randRange(min:Number, max:Number):Number {
 var randomNum:Number = Math.round(Math.random()*(max-min))+min;
 return randomNum;
 }
 _x = randRange(150, 520);
 _y = randRange(110, 290);
}
onClipEvent(enterFrame) {
 _x = _x;
 _y = _y - 2
 if(_y <= 110) {
  _y = 290;
 }
}

```

the FLA file can be downloaded from [http://www.alisongreen.me.uk/majorproject/w4/w4.fla](http://www.alisongreen.me.uk/majorproject/w4/w4.fla) if that’s any help? Thanks all, I’m stumped with this!!
