I need to load data from a database table using an ID that is sent to a modal window.

Basically, when the grid loads, there are multiple columns. Two in particular are called CONTAINER\_ID and WORKFLOW. 

Whatever is returned for WORKFLOW will be a link that opens up a MODAL popup called #mySVCModal. Here is the sample code:

```
 while(($Row = mysql_fetch_assoc($QueryResult)) !== FALSE)
 {
   echo "<tr";
   echo "<td style=\"width: 50px;\">{$Row[CONTAINER_ID]}</td>";
   echo "<td style=\"width: 50px;\"><a class=\"open-container\" 
             data-toggle=\"modal\" href="#mySVCModal\" 
             data-cont=\"{$Row[CONTAINER_ID]}\">{$Row[WORKFLOW]}</a></td>";
   echo "</tr>";
 }

```

When the user clicks on {$Row[WORKFLOW]}, a modal window opens up with the CONTAINER\_ID from the same row.

Here is the javascript that makes that happen:

```
 echo "<script type=\"text/javascript\">
          $(document).on(\"click\", \".open-Container\", function() {
          var myContainer = $(this).data('cont');
          $(\".modal-body #containerID\").val( myContainer );
          });
       </script>";

```

At this point, the modal window is open, and I can display the CONTAINER\_ID. Here is the code that displays the CONTAINER\_ID:

```
 <div id="mySVCModal">
   <form action="" method="POST">
     <input type="text" name="containerID" id="containerID" class="containerID" />
   *** more code here ***
   </form>
 </div>

```

So no problem. The CONTAINER\_ID is displayed in an INPUT field called "containerID".

What I need to make happen now is when the modal window opens, "containerID" is sent to a PHP variable that will retrieve the WORKFLOW information from a database table called WORKFLOW\_TABLE.

When I try to convert containerID into a PHP variable and echo it out, nothing is displayed:

```
 <?php
 $containerID = $_POST['containerID'];
 echo "this is containerID " . $containerID;  // only displays the text, not the $containerID
 ?>

```

I know that once I can get the code directly above to display the containerID in an ECHO, I can run a query off of it.

So basically, what I need to do is when the modal window opens, PHP will take containerID and run a " SELECT \* FROM WORKFLOW\_TABLE where CONTAINER\_ID = 'containerID' ";

The contents from WORKFLOW\_TABLE should automatically be displayed in various INPUT fields. I'm just using INPUT fields for now. That's beside the point.

So all in all, I need the modal to open up with the contents from WORKFLOW\_TABLE displayed using the containerID.

I hope I worded this clearly.

Please help.