connect "Filterable inside custom select " to mysql

connect "Filterable inside custom select " to mysql

Hello.
I have a problem. I want to use "Jquery Mobile 1.4.5 Filterable inside custom select" with a Mysql database for afficharge the list. with version 1.4.5 jquery mobile.
I would insert url connection file to the database in java script.
pourvez you help me?

<?php
$mysql_hostname = 'xxxxxxxxxx';
$mysql_user = 'xxxxxxx';
$mysql_database = 'xxxxxx';
$mysql_password ='xxxxxxxx';

$mysqli = new mysqli($mysql_hostname,$mysql_user, $mysql_password, $mysql_database);
$q = "select id, value, cyti from airepostliste";
$sql = $mysqli->query($q);
$data = array();
while($row = mysqli_fetch_array($sql, true)){
    $data[] = $row; 
};
echo json_encode($data);
?>

  <script > 
  $(document).ready(function(e){
  var items="";
  if(items==0) {items="<option value=''>A destination de ...</option>"; }
    $.getJSON("select.php",function(data){
    $.each(data,function(index,item) 
    {
      items+="<option value='"+item.value+"'>"+item.cyti+"</option>";
    });
    $(".AirpostList1").html(items);
  });
   }); 
  </script>


   <script>
( function( $ ) {
 function pageIsSelectmenuDialog( page ) {
var isDialog = false,
id = page && page.attr( "id" );

$( ".filterable-select" ).each( function() {
if ( $( this ).attr( "id" ) + "-dialog" === id ) {
isDialog = true;
return false;
}
});

return isDialog;
}
$.mobile.document

// Upon creation of the select menu, we want to make use of the fact that the ID of the
// listview it generates starts with the ID of the select menu itself, plus the suffix "-menu".
// We retrieve the listview and insert a search input before it.
.on( "selectmenucreate", ".filterable-select", function( event ) {
var input,
   items=""
selectmenu = $( event.target ),
list = $( "#" + selectmenu.attr( "id" ) + "-menu" ),
form = list.jqmData( "filter-form" );
// We store the generated form in a variable attached to the popup so we avoid creating a
// second form/input field when the listview is destroyed/rebuilt during a refresh.
if ( !form ) {
input = $( "<input data-type='search'></input>" );
form = $( "<form></form>" ).append( input );

input.textinput();

list
.before( form )
.jqmData( "filter-form", form ) ;
form.jqmData( "listview", list );
}

// Instantiate a filterable widget on the newly created selectmenu widget and indicate that
// the generated input form element is to be used for the filtering.
selectmenu
.filterable({
input: input,
children: "> option[value]"
})
// Rebuild the custom select menu's list items to reflect the results of the filtering
// done on the select menu.
.on( "filterablefilter", function() {
selectmenu.selectmenu( "refresh" );
});
})

// The custom select list may show up as either a popup or a dialog, depending on how much
// vertical room there is on the screen. If it shows up as a dialog, then the form containing
// the filter input field must be transferred to the dialog so that the user can continue to
// use it for filtering list items.
.on( "pagecontainerbeforeshow", function( event, data ) {
var listview, form;

// We only handle the appearance of a dialog generated by a filterable selectmenu
if ( !pageIsSelectmenuDialog( data.toPage ) ) {
return;
}

listview = data.toPage.find( "ul" );
form = listview.jqmData( "filter-form" );

// Attach a reference to the listview as a data item to the dialog, because during the
// pagecontainerhide handler below the selectmenu widget will already have returned the
// listview to the popup, so we won't be able to find it inside the dialog with a selector.
data.toPage.jqmData( "listview", listview );

// Place the form before the listview in the dialog.
listview.before( form );
})

// After the dialog is closed, the form containing the filter input is returned to the popup.
.on( "pagecontainerhide", function( event, data ) {
var listview, form;

// We only handle the disappearance of a dialog generated by a filterable selectmenu
if ( !pageIsSelectmenuDialog( data.toPage ) ) {
return;
}

listview = data.prevPage.jqmData( "listview" ),
form = listview.jqmData( "filter-form" );

// Put the form back in the popup. It goes ahead of the listview.
listview.before( form );
});

})( jQuery );


</script>

Here are the three scripts. I want to integrate the second script in the third script