I'm having problems passing a js global variable to PHP so I can query my DB for more data. I set the js variable on click of a link that loads a modal. In this example the variable is 'id3'. I need to pass that into php so I can include it in my where statement. Thanks!

JavaScript:

```
<script>
$("#cluster_profiles_dataTables").on("click", "a", function() {
   id3 = $(this).attr('id');
   document.querySelector('#clusterprofiletitlepulse').innerHTML = '<h4 class="modal-title" id="pulse">Profile Status' + ' (' + id3 + ')</h4>';
   document.querySelector('#clusterprofilepulsetable').innerHTML = '<i class="fa fa-long-arrow-right"></i> '+ id3 + ' Additional Anomalies';
    $('#cluster_profile_pulse_table').dataTable( {
     "sAjaxSource": "../scripts/cluster_profile_pulse_table.php?val=" + id3,
});

}); 
$('#clusterprofileanomalies').on('hidden.bs.modal', function () {
   $('#cluster_profile_pulse_table').dataTable().fnDestroy();
 });
</script>

```

PHP:

```
<?php
if (isset($_GET['id3'])) $id3 = $_GET['id3'];
$sql = "SELECT PROFILE_ATTACHED FROM <databasehidden> WHERE CLUSTER_NAME = '".$id3."'";
$stmt = sqlsrv_query( $conn, $sql );
    if( $stmt === false) {
        die( print_r( sqlsrv_errors(), true) );
    }

    while( $row = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC) ) {
    echo'<tr class="'.$class.'">
    <center>'.$row['PROFILE_ATTACHED'].'</center>
    </tr>';
    }

?>

```