I'm trying to get variable `$drop_var1` which is used in the first function to the second function which I need to use in the **SQL** Query. Every time I try to pass as Global variable or any other method it returns black or not data... I'm really at a lost on how to make this works

```
//**************************************
//     First selection results     //
//**************************************

if($_GET['func'] == "drop_1" && isset($_GET['func'])) { 
   $return_value = drop_1($_GET['drop_var']); 
}

function drop_1($drop_var1)
{ 
 $TD_DB_RESOURCE = open_teradata_resource();

$result2 = "SELECT DISTINCT a.call_id as id, b.call_name as name FROM call_log as a, call as b WHERE cust_id in ($drop_var1) and src_row_cre_dt between '2015-12-26' and '2015-12-26' and a.call_id = b.call_id";
echo $result2."<br>";
$arr_results = odbc_exec($TD_DB_RESOURCE, $result2);

    echo '<select name="drop_2" id="drop_2">
          <option value=" " disabled="disabled" selected="selected">Choose API</option>';

          while ($drop_2 = odbc_fetch_array($arr_results) )  
            {
            echo '<option value="'.$drop_2['id'].'">'.$drop_2['name'].'</option>';
            }   
    echo '</select><br><br>';

    echo "<script type=\"text/javascript\">
$('#wait_2').hide();
    $('#drop_2').change(function(){
      $('#wait_2').show();
      $('#result_2').hide();
      $.get(\"func.php\", {
        func: \"drop_2\",
        drop_var: $('#drop_2').val()
      }, function(response){
        $('#result_2').fadeOut();
        setTimeout(\"finishAjax_tier_three('result_2', '\"+escape(response)+\"')\", 400);
      });
        return false;
    });
</script>";
}

//**************************************
//     Second selection results     //
//**************************************

if($_GET['func'] == "drop_2" && isset($_GET['func'])) { 
   $return_value = drop_2($_GET['drop_var']); 
}

function drop_2($drop_var2)
{ 
  $TD_DB_RESOURCE = open_teradata_resource();

$result3 = "SELECT DISTINCT rc FROM call_log WHERE call_id in ('$drop_var2') and src_row_cre_dt between '2015-12-26' and '2015-12-26' and cust_id in ($drop_var1)";
echo $result3."<br>";   
$arr_results = odbc_exec($TD_DB_RESOURCE, $result3);

    echo '<select name="drop_3" id="drop_3">
          <option value=" " disabled="disabled" selected="selected">Choose API Error Code</option>';

          while ($drop_3 = odbc_fetch_array($arr_results) )  
            {
            echo '<option value="'.$drop_3['rc'].'">'.$drop_3['rc'].'</option>';
            }   
    echo '</select><br><br>';

    echo "<script type=\"text/javascript\">
$('#wait_3').hide();
    $('#drop_3').change(function(){
      $('#wait_3').show();
      $('#result_3').hide();
      $.get(\"func.php\", {
        func: \"drop_3\",
        drop_var: $('#drop_3').val()
      }, function(response){
        $('#result_3').fadeOut();
        setTimeout(\"finishAjax_tier_four('result_3', '\"+escape(response)+\"')\", 400);
      });
        return false;
    });
</script>";
}

```

here is what the queries look like

```
SELECT DISTINCT a.call_id as id, b.call_name as name FROM call_log as a, call as b WHERE cust_id in ('123456789') and src_row_cre_dt between '2015-12-26' and '2015-12-26' and a.call_id = b.call_id

SELECT DISTINCT rc FROM call_log WHERE call_id in ('29') and src_row_cre_dt between '2015-12-26' and '2015-12-26' and cust_id in ()

```