# Select is undefined from php and mysql

**URL:** <https://forum.kirupa.com/t/select-is-undefined-from-php-and-mysql/315849>\
**Category:** flash\
**Created:** [November 5, 2010, 4:26pm UTC](https://forum.kirupa.com/t/select-is-undefined-from-php-and-mysql/315849 "2010-11-05T16:26:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sleazyfish](https://avatars.discourse-cdn.com/v4/letter/s/e36b37/32.png) [@sleazyfish](https://forum.kirupa.com/u/sleazyfish)\
**Post date:** [November 5, 2010, 4:26pm UTC](https://forum.kirupa.com/t/select-is-undefined-from-php-and-mysql/315849/1 "2010-11-05T16:26:27Z")

</div>

I’m trying to create a button (view\_btn) that will load the selected item in a dataGrid - like an inbox that show the whole message once selected and view\_btn is pressed.

The basic info is in one table(A) and the full info is in another table(B) in a mysql database. The two are linked by (A) having a field that equals the id number of (B).

The basic info loads ok into a dataGrid. I can delete and insert new entries into both (A) and (B) ok and they’re linking fine.

I just seem to be having trouble getting the data into flash from (B)

It also shows “hello” in msg\_ta.text so i’m assuming that the connection has been made but when I - trace (view\_lv.b1); - it is undefined.

i have tested the php and it works. I’m having trouble either passing the variable ‘arrange’ to the php or showing the retreived data in flash.

can anyone help please?

```auto
 
view_lv.onLoad = function(ok:Boolean) {
 if (ok) {
  if (this.errorcode=="0") {
   for (var i:Number=0; i < this.n; i++) {
    viewInfo.push(
     {jingleID:this["id"+i],
      dater:this["date"+i],
      b1:this["b1"+i],
      b2:this["b2"+i],
      b3:this["b3"+i],
      b4:this["b4"+i]
     });
 
         msg_ta.text = "hello";
   }
      } else {
         // show kind of error
         msg_ta.text = errorMsgs[Number(this.errorcode)];
         // if query error, show mysql_error
         if (this.errorcode == "3") msg_ta.text += ": " + this.msg;
   }
   } else {
      // if loadvars failed (eg, if script not found)
      msg_ta.text = "Flash-database delete operation failed";
   }
};
function viewRecord() {
 viewIndex = scores_dg.selectedIndex;
 var arrange:Number = scores_dg.selectedItem.arrangement;
 view_lv.arrange = arrange;
 view_lv.sendAndLoad(filepath+"script.php",view_lv,"GET");
 
 //gotoAndStop('Viewer');
 trace(view_lv.b1);
}
view_btn.addEventListener("click", viewRecord);
 

```

Thanks in advance
